1 /* $TOG: usleep.c /main/6 1998/04/06 13:32:38 mgreess $ */
5 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
6 * (c) Copyright 1993, 1994 International Business Machines Corp. *
7 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
8 * (c) Copyright 1993, 1994 Novell, Inc. *
11 * usleep.c - OS dependant implementation of usleep().
13 * Copyright (c) 1991 by Patrick J. Naughton.
22 #if !defined(_AIX) && !defined(hpV4) && !defined(linux)
24 usleep(unsigned long usec)
27 poll((struct poll *) 0, (size_t) 0, usec / 1000); /* ms resolution */
29 struct timeval timeout;
30 timeout.tv_usec = usec % (unsigned long) 1000000;
31 timeout.tv_sec = usec / (unsigned long) 1000000;
32 select(0, (void *) 0, (void *) 0, (void *) 0, &timeout);
36 #endif /* !_AIX && !hpV4*/
39 * returns the number of seconds since 01-Jan-70.
40 * This is used to control rate and timeout in many of the animations.
47 gettimeofday(&now, (struct timezone *) 0);