From dcbf0c43c0042be2c730ddd58da08944b71e0544 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 19 Feb 2023 02:41:08 -0800 Subject: [PATCH] android: frontend: Cleanup framerate counter. --- .../java/org/yuzu/yuzu_emu/fragments/EmulationFragment.java | 5 ++--- src/android/app/src/main/jni/native.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.java index cc190eb7ff..2a2b0f68b8 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.java +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.java @@ -195,11 +195,10 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C { final double[] perfStats = NativeLibrary.GetPerfStats(); if (perfStats[FPS] > 0) { - mPerfStats.setText(String.format("FPS: %d Speed: %d%%", (int) (perfStats[FPS]), - (int) (perfStats[SPEED] * 100.0))); + mPerfStats.setText(String.format("FPS: %.1f", perfStats[FPS])); } - perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 3000); + perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 100); }; perfStatsUpdateHandler.post(perfStatsUpdater); diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index a8f3d135e0..2413a78f0e 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -198,7 +198,7 @@ public: while (true) { { 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; })) { // Emulation halted. break;