remove second ifdefs for windows timing by introducing ported version of clock_gettime
This commit is contained in:
@@ -176,3 +176,11 @@ int munlock(const void *addr, size_t len)
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Portable clock_gettime function for Windows
|
||||
int clock_gettime(int clk_id, struct timespec *tp) {
|
||||
DWORD ticks = GetTickCount();
|
||||
tp->tv_sec = ticks / 1000;
|
||||
tp->tv_nsec = (ticks % 1000) * 1000000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user