sec = 0 frames = 0 sys.stepinterval(0) function _step(t) s = math.floor(t / 1000) frames = frames + 1 if sec < s then print(frames .. " fps") sec = s frames = 0 end end function _shutdown(code) print("fps done! " .. tostring(code)) end