summaryrefslogtreecommitdiffstats
path: root/src/core/perf_stats.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/perf_stats.h')
-rw-r--r--src/core/perf_stats.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h
index 4098fc1f2..b03adab68 100644
--- a/src/core/perf_stats.h
+++ b/src/core/perf_stats.h
@@ -55,4 +55,20 @@ private:
u32 game_frames = 0;
};
+class FrameLimiter {
+public:
+ using Clock = std::chrono::high_resolution_clock;
+
+ void DoFrameLimiting(u64 current_system_time_us);
+
+private:
+ /// Emulated system time (in microseconds) at the last limiter invocation
+ u64 previous_system_time_us = 0;
+ /// Walltime at the last limiter invocation
+ Clock::time_point previous_walltime = Clock::now();
+
+ /// Accumulated difference between walltime and emulated time
+ std::chrono::microseconds frame_limiting_delta_err{0};
+};
+
} // namespace Core