summaryrefslogtreecommitdiff
path: root/src/core/perf_stats.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-20 14:18:03 -0400
committerGravatar GitHub2018-04-20 14:18:03 -0400
commit326b044c19df0b1a342acf87f2ba7cd06e9a1e97 (patch)
treed815c707b437b3685e8ba188bbf0940d4205de2a /src/core/perf_stats.cpp
parentMerge pull request #361 from lioncash/common (diff)
parentmath_util: Remove the Clamp() function (diff)
downloadyuzu-326b044c19df0b1a342acf87f2ba7cd06e9a1e97.tar.gz
yuzu-326b044c19df0b1a342acf87f2ba7cd06e9a1e97.tar.xz
yuzu-326b044c19df0b1a342acf87f2ba7cd06e9a1e97.zip
Merge pull request #367 from lioncash/clamp
math_util: Remove the Clamp() function
Diffstat (limited to 'src/core/perf_stats.cpp')
-rw-r--r--src/core/perf_stats.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp
index ad3b56fcc..5f53b16d3 100644
--- a/src/core/perf_stats.cpp
+++ b/src/core/perf_stats.cpp
@@ -2,6 +2,7 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm>
5#include <chrono> 6#include <chrono>
6#include <mutex> 7#include <mutex>
7#include <thread> 8#include <thread>
@@ -87,7 +88,7 @@ void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) {
87 frame_limiting_delta_err += microseconds(current_system_time_us - previous_system_time_us); 88 frame_limiting_delta_err += microseconds(current_system_time_us - previous_system_time_us);
88 frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime); 89 frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime);
89 frame_limiting_delta_err = 90 frame_limiting_delta_err =
90 MathUtil::Clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US); 91 std::clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US);
91 92
92 if (frame_limiting_delta_err > microseconds::zero()) { 93 if (frame_limiting_delta_err > microseconds::zero()) {
93 std::this_thread::sleep_for(frame_limiting_delta_err); 94 std::this_thread::sleep_for(frame_limiting_delta_err);