]> git.pld-linux.org Git - projects/rc-scripts.git/blob - src/usleep.c
Synced with 0.0.4
[projects/rc-scripts.git] / src / usleep.c
1 /* 
2  * usleep
3  * 
4  * Written by Donald Barnes <djb@redhat.com> for Red Hat Software.
5  *
6  */
7
8
9 #include <unistd.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include <stdio.h>
13
14 void main(int argc, char **argv)
15 {
16
17   double count;
18
19   if (argc == 1) count=1;
20   else if (!strcmp(argv[1], "--help"))
21     {
22     printf("usleep [number]\n   sleep [number] of microseconds\n        the default number to sleep is 1 microsecond\n");
23     exit(0);
24     }
25   else if (!strcmp(argv[1], "-v"))
26     {
27     printf("usleep version 1.0 by Donald Barnes <djb@redhat.com>\n      usleep --help for more info\n");
28     exit(0);
29     }
30   else 
31       count = strtod(argv[1], NULL); 
32
33   usleep(count);
34   exit(0);
35
36
37
This page took 0.034329 seconds and 3 git commands to generate.