aboutsummaryrefslogtreecommitdiffstats
path: root/src/usleep.c
blob: dbffc850c1be0af772d404235ef84144d64e65dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* 
 * usleep
 * 
 * Written by Donald Barnes <djb@redhat.com> for Red Hat Software.
 *
 */


#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

void main(int argc, char **argv)
{

  double count;

  if (argc == 1) count=1;
  else if (!strcmp(argv[1], "--help"))
    {
    printf("usleep [number]\n	sleep [number] of microseconds\n	the default number to sleep is 1 microsecond\n");
    exit(0);
    }
  else if (!strcmp(argv[1], "-v"))
    {
    printf("usleep version 1.0 by Donald Barnes <djb@redhat.com>\n	usleep --help for more info\n");
    exit(0);
    }
  else 
      count = strtod(argv[1], NULL); 

  usleep(count);
  exit(0);


}