Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Assert that uv_hrtime() actually sleeps for several microseconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis authored and ry committed Jul 1, 2011
1 parent 17ee773 commit 09bd08e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/test-hrtime.c
Expand Up @@ -41,13 +41,14 @@ TEST_IMPL(hrtime) {
uint64_t a, b, diff;

a = uv_hrtime();
uv_sleep(1);
uv_sleep(100);
b = uv_hrtime();

diff = b - a;

printf("diff = %llu\n", diff);

ASSERT(diff >= NANOSEC / MICROSEC);
ASSERT(diff > MICROSEC);
return 0;
}

0 comments on commit 09bd08e

Please sign in to comment.