2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $TOG: usleep.c /main/6 1998/04/06 13:32:38 mgreess $ */
27 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
28 * (c) Copyright 1993, 1994 International Business Machines Corp. *
29 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
30 * (c) Copyright 1993, 1994 Novell, Inc. *
33 * usleep.c - OS dependant implementation of usleep().
35 * Copyright (c) 1991 by Patrick J. Naughton.
44 #if !defined(_AIX) && !defined(hpV4) && !defined(linux) && !defined(CSRG_BASED)
46 usleep(unsigned long usec)
49 poll((struct poll *) 0, (size_t) 0, usec / 1000); /* ms resolution */
51 struct timeval timeout;
52 timeout.tv_usec = usec % (unsigned long) 1000000;
53 timeout.tv_sec = usec / (unsigned long) 1000000;
54 select(0, (void *) 0, (void *) 0, (void *) 0, &timeout);
58 #endif /* !_AIX && !hpV4*/
61 * returns the number of seconds since 01-Jan-70.
62 * This is used to control rate and timeout in many of the animations.
69 gettimeofday(&now, (struct timezone *) 0);