1
0
Fork 0
forked from suyu/suyu

android: frontend: Cleanup framerate counter.

This commit is contained in:
bunnei 2023-02-19 02:41:08 -08:00
parent 8248d69093
commit dcbf0c43c0
2 changed files with 3 additions and 4 deletions

View file

@ -195,11 +195,10 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
{ {
final double[] perfStats = NativeLibrary.GetPerfStats(); final double[] perfStats = NativeLibrary.GetPerfStats();
if (perfStats[FPS] > 0) { if (perfStats[FPS] > 0) {
mPerfStats.setText(String.format("FPS: %d Speed: %d%%", (int) (perfStats[FPS]), mPerfStats.setText(String.format("FPS: %.1f", perfStats[FPS]));
(int) (perfStats[SPEED] * 100.0)));
} }
perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 3000); perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 100);
}; };
perfStatsUpdateHandler.post(perfStatsUpdater); perfStatsUpdateHandler.post(perfStatsUpdater);

View file

@ -198,7 +198,7 @@ public:
while (true) { while (true) {
{ {
std::unique_lock lock(m_mutex); std::unique_lock lock(m_mutex);
if (m_cv.wait_for(lock, std::chrono::milliseconds(100), if (m_cv.wait_for(lock, std::chrono::milliseconds(800),
[&]() { return !m_is_running; })) { [&]() { return !m_is_running; })) {
// Emulation halted. // Emulation halted.
break; break;