How do I show fps?

Problems with Canvas, OpenGL, etc...

How do I show fps?

Postby tiggr » Mon Jun 21, 2010 8:35 am

I guess this is something everyone knows how to do, but I can't find any information about how to accually show the FPS on the screen/logcat or anything like that. So here goes:

How do I show FPS on the device/in debug?

And unless there is a standard way of doing this, how do you currently test this?

Posts: 3
Joined: Mon Jun 21, 2010 8:30 am


Re: How do I show fps?

Postby ShadowKntSDS » Mon Jun 21, 2010 6:05 pm

The best way to do this is in the logcat. Actually displaying it to the screen could significantly slow your FPS.

The most common way is to keep track of the time between each frame, and using that calculate an average FPS of the last X frames.

The most common ways for measuring time are uptimeMillis() and System.currentTimeMillis().
Junior Developer
Junior Developer
Posts: 15
Joined: Wed Apr 28, 2010 10:29 pm


Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests