mirror of https://github.com/PCSX2/pcsx2.git
Use correct clock for GS fps calculations on unix
This commit is contained in:
parent
37e2142cca
commit
ad29594d08
|
@ -34,10 +34,12 @@ void GSPerfMon::Put(counter_t c, double val)
|
||||||
if (c == Frame)
|
if (c == Frame)
|
||||||
{
|
{
|
||||||
#if defined(__unix__) || defined(__APPLE__)
|
#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;
|
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;
|
uint64 now = (uint64)ts.tv_sec * (uint64)1e6 + (uint64)ts.tv_nsec / (uint64)1e3;
|
||||||
#else
|
#else
|
||||||
clock_t now = clock();
|
clock_t now = clock();
|
||||||
|
|
Loading…
Reference in New Issue