Is there a way (maybe some apps, hacks, libs) to measure frames per second (FPS) during app development for Android?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 callSystemClock.elapsedRealtime()once per frame and subtract the value from the previous frame. SinceelapsedRealtime()is measured in milliseconds, calculating framerate is as simple as1000.0 / frametime.You can post your code into an ongoing frame by using
Choreographer#postFrameCallbackif 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)