Skip to content

Instantly share code, notes, and snippets.

@jakerr
Created May 14, 2012 14:03
Show Gist options
  • Save jakerr/2694183 to your computer and use it in GitHub Desktop.
Save jakerr/2694183 to your computer and use it in GitHub Desktop.
ltime = MOAISim.getElapsedTime()
lframe = MOAISim.getElapsedFrames()
function fps()
timer = MOAITimer.new()
timer:setSpan(5)
repeat
MOAIThread.blockOnAction(timer:start())
t = MOAISim.getElapsedTime()
f = MOAISim.getElapsedFrames()
fraps = (f-lframe) / (t - ltime)
textbox:setString("fps" .. fraps)
lframe = f
ltime = t
coroutine.yield()
until false
end
thread = MOAIThread.new ()
thread:run ( fps )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment