mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #799
aaaf9e2
Fix get_tick_count() on Windows (Howard Chu)
This commit is contained in:
commit
abea280dd3
1 changed files with 7 additions and 5 deletions
|
@ -53,11 +53,13 @@ namespace misc_utils
|
|||
#if defined(_MSC_VER)
|
||||
return ::GetTickCount64();
|
||||
#elif defined(WIN32)
|
||||
# if defined(WIN64)
|
||||
return GetTickCount64();
|
||||
# else
|
||||
return GetTickCount();
|
||||
# endif
|
||||
static LARGE_INTEGER pcfreq = {0};
|
||||
LARGE_INTEGER ticks;
|
||||
if (!pcfreq.QuadPart)
|
||||
QueryPerformanceFrequency(&pcfreq);
|
||||
QueryPerformanceCounter(&ticks);
|
||||
ticks.QuadPart *= 1000; /* we want msec */
|
||||
return ticks.QuadPart / pcfreq.QuadPart;
|
||||
#elif defined(__MACH__)
|
||||
clock_serv_t cclock;
|
||||
mach_timespec_t mts;
|
||||
|
|
Loading…
Reference in a new issue