summaryrefslogtreecommitdiffstats
path: root/src/core/perf_stats.h
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-02-21 01:31:59 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-02-27 02:22:04 +0100
commitfb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61 (patch)
tree690461954bff040727fa2cb3b34c9d71c003ea9c /src/core/perf_stats.h
parentCore: Make PerfStats internally locked (diff)
downloadyuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.tar
yuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.tar.gz
yuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.tar.bz2
yuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.tar.lz
yuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.tar.xz
yuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.tar.zst
yuzu-fb1979d7e26c20fe2b8d2c3d3dc998e5e00f2f61.zip
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