1 //-----------------------------------------------------------------------------
2 // platform-independant sleep macros
3 //-----------------------------------------------------------------------------
10 #define msleep(n) Sleep(n)
14 static void nsleep(uint64_t n
) {
15 struct timespec timeout
;
16 timeout
.tv_sec
= n
/ 1000000000;
17 timeout
.tv_nsec
= n
% 1000000000;
18 while (nanosleep(&timeout
, &timeout
) && errno
== EINTR
);
20 #define msleep(n) nsleep(1000000 * (uint64_t)n)