improved sleep by using usleep() instead of sleep()

which allows more precise times
This commit is contained in:
qorg11 2020-08-07 00:13:17 +02:00
parent 0d806ef04b
commit fdd35796cb
No known key found for this signature in database
GPG Key ID: 343FC20A4ACA62B9
1 changed files with 4 additions and 3 deletions

View File

@ -1,15 +1,16 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
if(argc == 1)
{
printf("missing opperand\n");
fprintf(stderr,"missing opperand\n");
return 1;
}
usleep(atof(argv[1]) * 1000000);
sleep(atoi(argv[1]));
return 0;
}