ok since I'm going to bed . . . if you just wish to update the text the command:
Code:
dataobj.text = string.format("%.1f FPS", fps)
is really the meat of it. (Yes that's pretty much it, it's simpler than you are making it I am thinking)
Good luck I'll check this after I wake my rear end up.