Improve time/sleep accuracy on Windows

It's now almost as good as Linux thanks to a Windows 8+ API.
This commit is contained in:
Justine Tunney 2023-11-18 01:57:44 -08:00
parent 72ac5f18d9
commit 8caf1b48a9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 76 additions and 31 deletions

View file

@ -50,7 +50,7 @@ TEST(clock_gettime, testClockRealtime) {
EXPECT_LT((unsigned)ABS(ts.tv_sec - tv.tv_sec), 5u);
}
BENCH(clock_gettime, bench) {
TEST(clock_gettime, bench) {
struct timeval tv;
struct timespec ts;
gettimeofday(&tv, 0); // trigger init