diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index f1ae9d4df5..6218084ff5 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -108,13 +108,15 @@ PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us system_frames = 0; game_frames = 0; + target_fps = static_cast(results.game_fps / results.emulation_speed); + return results; } double PerfStats::GetLastFrameTimeScale() { std::lock_guard lock{object_mutex}; - constexpr double FRAME_LENGTH = 1.0 / 60; + double FRAME_LENGTH = 1.0 / target_fps; return duration_cast(previous_frame_length).count() / FRAME_LENGTH; } diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h index d9a64f072d..9c955cc24d 100644 --- a/src/core/perf_stats.h +++ b/src/core/perf_stats.h @@ -81,6 +81,8 @@ private: Clock::time_point frame_begin = reset_point; /// Total visible duration (including frame-limiting, etc.) of the previous system frame Clock::duration previous_frame_length = Clock::duration::zero(); + + u32 target_fps{60}; }; class FrameLimiter {