PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Does limiting your framerate increase battery life?

I am optimizing a game and since it it turn based I can limit the framerate at certian times (like when no intense action is going on, but there is still slight animation). Does anyone know if putting Sleep(10)'s to limit the framerate to say around 15fps will have a noticible effect on battery life?

My guess is it might because when a Sleep(10) is seen by the OS the CPU can be put into a low power state for that brief moment. Or perhaps that length is too short and it can't save power so it would have no effect.

This probably depends on the device, OS, ROM version, etc, but does anyone know if any devices are known to save power this way?
Yes, this'll help. Just a little Sleep()ing can reduce the strain on the CPU, which makes it draw less power and also keeps it cooler. You should benchmark the difference. :)

For most of my games, I have the framerate set to 30fps, so at the start of the game loop, I determine how long the last frame took (current_tick-last_tick), and if it's less than 33, I Sleep for 33-(current_tick-last_tick), which seems to work really well. Also, if nothing has changed on screen, I only draw the frame every 2 seconds. I haven't benchmarked it, but I've noticed the battery lasts longer and the device doesn't get as hot as it used to.

-John
We SetTimer() for a rate of 30HZ and use the normal GetMessage() window loop. Since WM_TIMER comes through at a nice rate, something is always happening and it plays very nicely with the rest of the system. Letting the message loop (rumor has it) is at least as power friendly as Sleep(). (the rumor says that it can be better).