有没有一种方法(也许是一些应用程序,黑客,库)来衡量应用程序开发Android的过程中每秒帧数(FPS)?
Is there a way (maybe some apps, hacks, libs) to measure frames per second (FPS) during app development for Android?
推荐答案请注意,性能将是可怕的与调试器连接。
Note that performance will be terrible with the debugger attached.
这是我自己的Android游戏,帧时间可以和android.os.SystemClock.也就是说,你叫 SystemClock.elapsedRealtime()每帧一次,并减去从previous框的值。由于 elapsedRealtime()以毫秒为单位,计算帧率很简单,只要 1 / frameTime的。
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 1 / frametime.
另外请注意,frameTime的一般是更好地衡量性能比帧率。 1000fps和1200fps之间的差的时间作为60帧和61fps(约,可能比,虽然少)
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)
更多推荐
如何应用程序开发过程中衡量FPS在Android
发布评论