diff options
author | Lioncash <mathew1800@gmail.com> | 2018-08-06 04:07:28 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-08-06 04:07:30 +0200 |
commit | a0c3a46aa9d2186e833bdc1872f9eb877230b429 (patch) | |
tree | a8715386f729ac3b10f0862de5e8b08537495673 /src/core/perf_stats.cpp | |
parent | Merge pull request #927 from bunnei/fix-texs (diff) | |
download | yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.tar yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.tar.gz yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.tar.bz2 yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.tar.lz yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.tar.xz yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.tar.zst yuzu-a0c3a46aa9d2186e833bdc1872f9eb877230b429.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/perf_stats.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 5f53b16d3..22be6d712 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -40,22 +40,21 @@ void PerfStats::EndGameFrame() { game_frames += 1; } -PerfStats::Results PerfStats::GetAndResetStats(u64 current_system_time_us) { +PerfStats::Results PerfStats::GetAndResetStats(microseconds current_system_time_us) { std::lock_guard<std::mutex> lock(object_mutex); - auto now = Clock::now(); + const auto now = Clock::now(); // Walltime elapsed since stats were reset - auto interval = duration_cast<DoubleSecs>(now - reset_point).count(); + const auto interval = duration_cast<DoubleSecs>(now - reset_point).count(); - auto system_us_per_second = - static_cast<double>(current_system_time_us - reset_point_system_us) / interval; + const auto system_us_per_second = (current_system_time_us - reset_point_system_us) / interval; Results results{}; results.system_fps = static_cast<double>(system_frames) / interval; results.game_fps = static_cast<double>(game_frames) / interval; results.frametime = duration_cast<DoubleSecs>(accumulated_frametime).count() / static_cast<double>(system_frames); - results.emulation_speed = system_us_per_second / 1'000'000.0; + results.emulation_speed = system_us_per_second.count() / 1'000'000.0; // Reset counters reset_point = now; @@ -74,7 +73,7 @@ double PerfStats::GetLastFrameTimeScale() { return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH; } -void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) { +void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { // Max lag caused by slow frames. Can be adjusted to compensate for too many slow frames. Higher // values increase the time needed to recover and limit framerate again after spikes. constexpr microseconds MAX_LAG_TIME_US = 25ms; |