Fix time_update() to compile and work on MinGW.
This commit is contained in:
parent
56139dc403
commit
fd9cd7a6cc
@ -161,12 +161,15 @@ time_update(struct timespec *time)
|
|||||||
time_copy(&old_time, time);
|
time_copy(&old_time, time);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
{
|
||||||
FILETIME ft;
|
FILETIME ft;
|
||||||
uint64_t ticks;
|
uint64_t ticks;
|
||||||
GetSystemTimeAsFileTime(&ft);
|
GetSystemTimeAsFileTime(&ft);
|
||||||
ticks = (ft.dwHighDateTime << 32) | ft.dWLowDateTime;
|
ticks = (((uint64_t)ft.dwHighDateTime) << 32) |
|
||||||
time->tv_sec = ticks / 10000;
|
ft.dwLowDateTime;
|
||||||
time->tv_nsec = ((ticks % 10000) * 100);
|
time->tv_sec = ticks / 10000000;
|
||||||
|
time->tv_nsec = ((ticks % 10000000) * 100);
|
||||||
|
}
|
||||||
#elif JEMALLOC_CLOCK_GETTIME
|
#elif JEMALLOC_CLOCK_GETTIME
|
||||||
if (sysconf(_SC_MONOTONIC_CLOCK) > 0)
|
if (sysconf(_SC_MONOTONIC_CLOCK) > 0)
|
||||||
clock_gettime(CLOCK_MONOTONIC, time);
|
clock_gettime(CLOCK_MONOTONIC, time);
|
||||||
|
Loading…
Reference in New Issue
Block a user