summaryrefslogtreecommitdiff
path: root/src/core/perf_stats.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-02-19 18:18:26 -0800
committerGravatar Yuri Kunde Schlesner2017-02-26 17:22:03 -0800
commit92c8bd4b1f650438274e50303a6d3f668924d071 (patch)
tree0c9e162129dabd2424ee329b51f5765a73f6a494 /src/core/perf_stats.h
parentAdd performance statistics to status bar (diff)
downloadyuzu-92c8bd4b1f650438274e50303a6d3f668924d071.tar.gz
yuzu-92c8bd4b1f650438274e50303a6d3f668924d071.tar.xz
yuzu-92c8bd4b1f650438274e50303a6d3f668924d071.zip
PerfStats: Add method to get the instantaneous time ratio
Diffstat (limited to 'src/core/perf_stats.h')
-rw-r--r--src/core/perf_stats.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h
index 566a1419a..8a03c511a 100644
--- a/src/core/perf_stats.h
+++ b/src/core/perf_stats.h
@@ -30,11 +30,19 @@ public:
30 30
31 Results GetAndResetStats(u64 current_system_time_us); 31 Results GetAndResetStats(u64 current_system_time_us);
32 32
33 /**
34 * Gets the ratio between walltime and the emulated time of the previous system frame. This is
35 * useful for scaling inputs or outputs moving between the two time domains.
36 */
37 double GetLastFrameTimeScale();
38
33private: 39private:
34 Clock::time_point reset_point = Clock::now(); 40 Clock::time_point reset_point = Clock::now();
35 41
36 Clock::time_point frame_begin; 42 Clock::time_point frame_begin = reset_point;
43 Clock::time_point previous_frame_end = reset_point;
37 Clock::duration accumulated_frametime = Clock::duration::zero(); 44 Clock::duration accumulated_frametime = Clock::duration::zero();
45 Clock::duration previous_frame_length = Clock::duration::zero();
38 u64 reset_point_system_us = 0; 46 u64 reset_point_system_us = 0;
39 u32 system_frames = 0; 47 u32 system_frames = 0;
40 u32 game_frames = 0; 48 u32 game_frames = 0;