From 564fd36c8e21b50229876ab402af4b3f834b1ebc Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 21 Apr 2013 19:10:37 +1000 Subject: [PATCH] Use cgtime in compat.h --- compat.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compat.h b/compat.h index 0059a17d..ed18baa5 100644 --- a/compat.h +++ b/compat.h @@ -9,6 +9,7 @@ #include #include "miner.h" // for timersub +#include "util.h" #include @@ -18,7 +19,7 @@ static inline int nanosleep(const struct timespec *req, struct timespec *rem) struct timeval tstart; DWORD msecs; - gettimeofday(&tstart, NULL); + cgtime(&tstart); msecs = (req->tv_sec * 1000) + ((999999 + req->tv_nsec) / 1000000); if (SleepEx(msecs, true) == WAIT_IO_COMPLETION) { @@ -31,7 +32,7 @@ static inline int nanosleep(const struct timespec *req, struct timespec *rem) ++tdone.tv_sec; } - gettimeofday(&tnow, NULL); + cgtime(&tnow); if (timercmp(&tnow, &tdone, >)) return 0; timersub(&tdone, &tnow, &tleft);