Framerate fluctuates wildly

Put your problem here if it does not fit any of the other categories.

Framerate fluctuates wildly

Postby CodeX » Tue Apr 05, 2011 12:59 am

I have some skeleton code that does nothing but draws the framerate to the screen. I use a SurfaceView and get access to the canvas to draw directly to the screen using Canvas.drawText() and that is all that happens in the loop.

The frame rate, as calculated using the difference between the milliseconds reported by SystemClock.uptimeMillis() from one draw to the next, jumps from 40fps up to several hundred fps and it's all over the place, it doesn't settle on a tight range and then change over some time, it seems to fluctuate randomly and constantly in a huge range...

I was wondering if anyone had any understanding why this might be or if there is anything I can do about it (set the priority of my app higher? something like that...)

I have the drawing frequency locked to 50fps right now in order to continue developing my game, but it troubles me that it dips below that when I am not doing anything at all...
Posts: 4
Joined: Tue Apr 05, 2011 12:52 am


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 3 guests