It looks like you're new here. If you want to get involved, click one of these buttons!
const=120 frameCount=0 currentTimer=0 function onTimer() --fps counter: frameCount = frameCount + 1 if frameCount == const then local timer = os.timer() local deltaTime = timer - currentTimer currentTimer = timer local fps_test=const/deltaTime print ("timer real fps: ".. fps_test) frameCount = 0 end end frameCount2=0 currentTimer2=0 function onEnterFrame() --fps counter: frameCount2 = frameCount2 + 1 if frameCount2 == const then local timer = os.timer() local deltaTime = timer - currentTimer2 currentTimer2 = timer local fps_test=const/deltaTime print ("enterframe real fps: ".. fps_test) frameCount2 = 0 end end _fps=60 timer=Timer.new(1000/_fps) timer:addEventListener(Event.TIMER, onTimer,self) stage:addEventListener(Event.ENTER_FRAME, onEnterFrame,self) timer:start() |
Comments
it looks i will just have to use enterframe then and write my own 'timer' running within this enterframe and using os.timer to time the calls.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://deluxepixel.com
There is probably a bug somewhere in gideros though since I can't find any wrong in your Lua code.
EDIT: looking better at the code, it looks like everything was made so that it would behave as you said, but a tiny bug makes it behave as I said in the end! We'll have it fixed
Likes: keszegh, antix
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game