如何应用程序开发过程中衡量FPS在Android

编程入门 行业动态 更新时间:2024-10-26 09:28:57
本文介绍了如何应用程序开发过程中衡量FPS在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有一种方法(也许是一些应用程序,黑客,库)来衡量应用程序开发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.

这是我自己的Andr​​oid游戏,帧时间可以和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

本文发布于:2023-07-22 04:06:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1184007.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序开发   过程中   Android   FPS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!