How to measure FPS on Android during app development
android, performance
Solution
Note that performance will be terrible with the debugger attached.
From my own Android game, frame time can be measured with `android.os.SystemClock`. That is, you call `SystemClock.elapsedRealtime()` once per frame and subtract the value from the previous frame. Since `elapsedRealtime()` is measured in milliseconds, calculating framerate is as simple as `1000.0 / frametime`.
You can post your code into an ongoing frame by using `Choreographer#postFrameCallback` if targeting API level 16 or newer (Jelly Bean).
Also note that frametime is generally a better gauge of performance than framerate. The difference between 1000fps and 1200fps is the same amount of time as the difference between 60fps and 61fps (approximately, probably less than that though)
Problem
Is there a way (maybe some apps, hacks, libs) to measure frames per second (FPS) during app development for Android?