k9core

Unnamed repository
Log | Files | Refs | LICENSE

commit fdd35796cb7a2289d33d85ef0e8003964ae69a7d
parent 0d806ef04be14142bf40093d30bee42e6e2a3cd7
Author: qorg11 <qorg@vxempire.xyz>
Date:   Fri,  7 Aug 2020 00:13:17 +0200

improved sleep by using usleep() instead of sleep()
which allows more precise times

Diffstat:
Msrc/sleep.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/sleep.c b/src/sleep.c @@ -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; }