diff --git a/test/test-hrtime.c b/test/test-hrtime.c index e7309804..41f9f1c9 100644 --- a/test/test-hrtime.c +++ b/test/test-hrtime.c @@ -23,6 +23,10 @@ #include "task.h" +/* + * We expect the amount of time passed to be at least one us plus two system + * calls. Therefore checking that at least a microsecond has elapsed is safe. + */ TEST_IMPL(hrtime) { uint64_t a, b, diff; @@ -33,5 +37,7 @@ TEST_IMPL(hrtime) { diff = b - a; printf("diff = %llu\n", diff); - ASSERT(b - a >= NANOSEC / MILLISEC); + + ASSERT(diff >= NANOSEC / MICROSEC); + return 0; }