aboutsummaryrefslogtreecommitdiff
path: root/src/core/perf_stats.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-04-19 23:01:50 -0400
committerLioncash <mathew1800@gmail.com>2018-04-20 10:14:13 -0400
commitfae2dd034462c5a6b086e46b3437ea6e2456d5eb (patch)
tree3a53e7b4786e4712874d63a2a1cecc6755475051 /src/core/perf_stats.cpp
parent17ad56c1dce85e71d5ab8a87efd7d43d87cacd92 (diff)
math_util: Remove the Clamp() function
C++17 adds clamp() to the standard library, so we can remove ours in favor of it.
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 ad3b56fcc8..5f53b16d34 100644
--- a/src/core/perf_stats.cpp
+++ b/src/core/perf_stats.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <algorithm>
#include <chrono>
#include <mutex>
#include <thread>
@@ -87,7 +88,7 @@ void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) {
frame_limiting_delta_err += microseconds(current_system_time_us - previous_system_time_us);
frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime);
frame_limiting_delta_err =
- MathUtil::Clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US);
+ std::clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US);
if (frame_limiting_delta_err > microseconds::zero()) {
std::this_thread::sleep_for(frame_limiting_delta_err);