android: Stop updating fps counter when emulation stops

This commit is contained in:
Charles Lombardo 2023-03-21 21:23:10 -04:00 committed by bunnei
parent a49a24b079
commit 1634391bff

View file

@ -168,7 +168,10 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
if (perfStats[FPS] > 0) { if (perfStats[FPS] > 0) {
binding.showFpsText.text = String.format("FPS: %.1f", perfStats[FPS]) binding.showFpsText.text = String.format("FPS: %.1f", perfStats[FPS])
} }
perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 100)
if (!emulationState.isStopped) {
perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 100)
}
} }
perfStatsUpdateHandler.post(perfStatsUpdater!!) perfStatsUpdateHandler.post(perfStatsUpdater!!)
binding.showFpsText.visibility = View.VISIBLE binding.showFpsText.visibility = View.VISIBLE