core: perf_stats: GetLastFrameTimeScale should reflect target framerate.

This commit is contained in:
bunnei
2020-01-24 20:23:13 -05:00
parent 18c65db107
commit 551182ae31
2 changed files with 5 additions and 1 deletions

View File

@@ -108,13 +108,15 @@ PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us
system_frames = 0;
game_frames = 0;
target_fps = static_cast<u32>(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<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH;
}

View File

@@ -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 {