gamebench是如何实现计算unity3d游戏的FPS的?

How is gamebench implemented to calculate the FPS of unity3d games?

Unity3d 游戏引擎在 android 手机上的每秒帧数如何使用 gamebench

尝试通过 adb 命令使用 gfxinfo,没有多大帮助?

需要更多帮助如何计算 unity3d 游戏在 Android 上的 FPS?

我的猜测是它[以编程方式]使用这些命令:

(1) adb shell dumpsys SurfaceFlinger --latency-clear

(2) adb shell dumpsys SurfaceFlinger --latency <window name>

例如

adb shell dumpsys SurfaceFlinger --latency com.android.settings/com.android.settings.SubSettings

RefreshPeriod <-- Time in nano seconds
desiredPresentTime actualPresentTime frameReadyTime <-- Time in nano seconds
desiredPresentTime actualPresentTime frameReadyTime
desiredPresentTime actualPresentTime frameReadyTime
...

关于如何解释结果,请参阅 https://chromium.googlesource.com/chromium/src/build/+/fefabac95d6aee4d941111e67f606dc50dfe9dd1/android/pylib/perf/surface_stats_collector.py#215https://android.googlesource.com/platform/frameworks/native/+/86efcc0/services/surfaceflinger/FrameTracker.cpp#217