diff options
Diffstat (limited to 'src/core/perf_stats.h')
| -rw-r--r-- | src/core/perf_stats.h | 16 |
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: | |||
| 55 | u32 game_frames = 0; | 55 | u32 game_frames = 0; |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | class FrameLimiter { | ||
| 59 | public: | ||
| 60 | using Clock = std::chrono::high_resolution_clock; | ||
| 61 | |||
| 62 | void DoFrameLimiting(u64 current_system_time_us); | ||
| 63 | |||
| 64 | private: | ||
| 65 | /// Emulated system time (in microseconds) at the last limiter invocation | ||
| 66 | u64 previous_system_time_us = 0; | ||
| 67 | /// Walltime at the last limiter invocation | ||
| 68 | Clock::time_point previous_walltime = Clock::now(); | ||
| 69 | |||
| 70 | /// Accumulated difference between walltime and emulated time | ||
| 71 | std::chrono::microseconds frame_limiting_delta_err{0}; | ||
| 72 | }; | ||
| 73 | |||
| 58 | } // namespace Core | 74 | } // namespace Core |