Add win32 implementation of nanosleep
This commit is contained in:
parent
5ef9f02a19
commit
3e014f366e
8
time.cpp
8
time.cpp
@ -37,6 +37,14 @@ util::nanoseconds (void) {
|
|||||||
|
|
||||||
return ((double)count.QuadPart / freq.QuadPart) * 1000000000UL;
|
return ((double)count.QuadPart / freq.QuadPart) * 1000000000UL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
util::sleep (uint64_t ns) {
|
||||||
|
static const uint64_t ns_in_ms = 1000000;
|
||||||
|
Sleep (ns / ns_in_ms);
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
Loading…
Reference in New Issue
Block a user