mirror of https://github.com/PCSX2/pcsx2.git
LnxMisc: Use clock_gettime() instead of gettimeofday()
This commit is contained in:
parent
5665e5e222
commit
f9707e6809
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue