1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

uptime(2) now reports usecs instead of msecs.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-12-04 21:27:21 +01:00
parent 597e700618
commit 854d9b171a
6 changed files with 16 additions and 16 deletions

View file

@ -11,7 +11,7 @@ int main(int argc, char* argv[])
uintmax_t start;
if ( uptime(&start) ) { perror("uptime"); return 1; }
uintmax_t end = start + 1ULL * 1000ULL; // 1 second
uintmax_t end = start + 1ULL * 1000ULL * 1000ULL; // 1 second
size_t count = 0;
uintmax_t now;
while ( !uptime(&now) && now < end ) { usleep(0); count += 2; /* back and forth */ }

View file

@ -5,7 +5,7 @@ int main(int argc, char* argv[])
{
uintmax_t start;
if ( uptime(&start) ) { perror("uptime"); return 1; }
uintmax_t end = start + 1ULL * 1000ULL; // 1 second
uintmax_t end = start + 1ULL * 1000ULL * 1000ULL; // 1 second
size_t count = 0;
uintmax_t now;
while ( !uptime(&now) && now < end ) { count++; }