LnxMisc: Use clock_gettime() instead of gettimeofday()

This commit is contained in:
Connor McLaughlin 2022-04-07 22:41:07 +10:00 committed by refractionpcsx2
parent 5665e5e222
commit f9707e6809
1 changed files with 4 additions and 4 deletions

View File

@ -41,14 +41,14 @@ void InitCPUTicks()
u64 GetTickFrequency()
{
return 1000000; // unix measures in microseconds
return 1000000000;// unix measures in nanoseconds
}
u64 GetCPUTicks()
{
struct timeval t;
gettimeofday(&t, NULL);
return ((u64)t.tv_sec * GetTickFrequency()) + t.tv_usec;
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (static_cast<u64>(ts.tv_sec) * 1000000000ULL) + ts.tv_nsec;
}
wxString GetOSVersionString()