Fix issues with previous commit

This commit is contained in:
Justine Tunney 2024-09-10 01:59:46 -07:00
parent 2f48a02b44
commit a0a404a431
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 122 additions and 57 deletions

View file

@ -19,6 +19,7 @@
#include <assert.h>
#include <stdio.h>
#include <time.h>
#include "libc/assert.h"
#define MAXIMUM 1e9
#define ITERATIONS 10
@ -45,7 +46,7 @@ void TestSleepRelative(int clock) {
if (clock_gettime(clock, &t1))
return;
for (int i = 0; i < ITERATIONS; ++i) {
assert(!clock_nanosleep(clock, 0, &wf, 0));
unassert(!clock_nanosleep(clock, 0, &wf, 0));
}
clock_gettime(clock, &t2);
long took = timespec_tonanos(timespec_sub(t2, t1)) / ITERATIONS;