fps really slow in simulator?

I had problems to get decent precision using timer.performWithDelay() and I was only able to trigger a function twice per second at the fastest.

Then I read: http://spiralcodestudio.com/corona-sdk-pro-tip-of-the-day-33/

I tested with a main.lua looking like this:

====

local lastTime = system.getTimer()

local function enterFrame()

  local now = system.getTimer()

  print("last: " … tostring(now - lastTime))

  lastTime = now

end

Runtime:addEventListener(“enterFrame”, enterFrame)

====

Then I got this in the simulator console:

nov. 26 11:38:58.203 last: 613.406

nov. 26 11:38:58.908 last: 704.866

nov. 26 11:38:59.488 last: 580.402

nov. 26 11:38:59.926 last: 437.98

nov. 26 11:39:00.678 last: 752.353

nov. 26 11:39:01.529 last: 850.662

nov. 26 11:39:02.220 last: 691.133

nov. 26 11:39:03.001 last: 780.807

nov. 26 11:39:03.737 last: 736.13

nov. 26 11:39:04.457 last: 718.099

nov. 26 11:39:05.059 last: 603.991

That means  0.5-2fps

Depressing

I must be doing something very wrong or most probably being a total noob.

I use a MacBook Air (1,6 GHz Intel Core i5, 8 GB 1600 MHz DDR3, Intel HD Graphics 6000 1536 MB)

:frowning:

/Joakim

Please use code blocks in posts.
formatyourcode.jpg

Questions

  • Is that your entire program? i.e. This is all you are doing.
  • Have you tried rebooting?
  • What else is running on your system?
  • Are your graphics drivers up-to-date?
  • What version of Corona are you using? ex: 2016.2992

This will print the exact fps per-frame

local getTimer = system.getTimer local last = getTimer() local function enterFrame() local cur = getTimer() local dt = cur-last last = cur local fps = 1000/dt print( string.format( "FPS: %3.3f", fps ) ) end Runtime:addEventListener("enterFrame", enterFrame)

Thanks for your fast reply. I rebooted my machine. It solved the problem. Blushing.

Thanks

/Joakim

PS Steve Jobs come back. They are screwing things up. DS

Don’t feel bad.

All modern (consumer) OSes suffer from long-run degradation.  As well, depending on about a million other things you might simply have had some rogue process eating up all your resources or tying up the ones the Corona needed.

Glad you got it sorted.

Cheers,

Ed

Please use code blocks in posts.
formatyourcode.jpg

Questions

  • Is that your entire program? i.e. This is all you are doing.
  • Have you tried rebooting?
  • What else is running on your system?
  • Are your graphics drivers up-to-date?
  • What version of Corona are you using? ex: 2016.2992

This will print the exact fps per-frame

local getTimer = system.getTimer local last = getTimer() local function enterFrame() local cur = getTimer() local dt = cur-last last = cur local fps = 1000/dt print( string.format( "FPS: %3.3f", fps ) ) end Runtime:addEventListener("enterFrame", enterFrame)

Thanks for your fast reply. I rebooted my machine. It solved the problem. Blushing.

Thanks

/Joakim

PS Steve Jobs come back. They are screwing things up. DS

Don’t feel bad.

All modern (consumer) OSes suffer from long-run degradation.  As well, depending on about a million other things you might simply have had some rogue process eating up all your resources or tying up the ones the Corona needed.

Glad you got it sorted.

Cheers,

Ed