From ad29594d0804e7d0a0268b4eb3977350464a41bd Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 8 Aug 2020 15:01:29 -0500 Subject: [PATCH] Use correct clock for GS fps calculations on unix --- pcsx2/GS/GSPerfMon.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pcsx2/GS/GSPerfMon.cpp b/pcsx2/GS/GSPerfMon.cpp index adc81da470..5f40489d74 100644 --- a/pcsx2/GS/GSPerfMon.cpp +++ b/pcsx2/GS/GSPerfMon.cpp @@ -34,10 +34,12 @@ void GSPerfMon::Put(counter_t c, double val) if (c == Frame) { #if defined(__unix__) || defined(__APPLE__) - // clock on linux will return CLOCK_PROCESS_CPUTIME_ID. - // CLOCK_THREAD_CPUTIME_ID is much more useful to measure the fps struct timespec ts; - clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); +# ifdef CLOCK_MONOTONIC_RAW + clock_gettime(CLOCK_MONOTONIC_RAW, &ts); +# else + clock_gettime(CLOCK_MONOTONIC, &ts); +# endif uint64 now = (uint64)ts.tv_sec * (uint64)1e6 + (uint64)ts.tv_nsec / (uint64)1e3; #else clock_t now = clock();