1 /* xscreensaver, Copyright (c) 1992, 1996, 1997
2 * Jamie Zawinski <jwz@netscape.com>
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation. No representations are made about the suitability of this
9 * software for any purpose. It is provided "as is" without express or
15 #else /* !HAVE_CONFIG_H */
19 #endif /* !HAVE_CONFIG_H */
28 # include <lib$routines.h>
29 #elif defined(HAVE_SELECT)
30 # include <sys/time.h> /* for struct timeval */
34 #ifdef __SCREENHACK_USLEEP_H__
35 ERROR, do not include that here
39 screenhack_usleep (unsigned long usecs)
42 float seconds = ((float) usecs)/1000000.0;
43 unsigned long int statvms = lib$wait(&seconds);
45 #elif defined(HAVE_SELECT)
46 /* usleep() doesn't exist everywhere, and select() is faster anyway. */
48 tv.tv_sec = usecs / 1000000L;
49 tv.tv_usec = usecs % 1000000L;
50 (void) select (0, 0, 0, 0, &tv);
52 #else /* !VMS && !HAVE_SELECT */
53 /* If you don't have select() or usleep(), I guess you lose...
54 Maybe you have napms() instead? Let me know. */
57 #endif /* !VMS && !HAVE_SELECT */