Debian Codegraph @

lib/util/nsleep.c

raw
1 #include "pm_config.h"
2
3 #if MSVCRT
4 #include <windows.h>
5 #include <process.h>
6 #else
7 #include <unistd.h>
8 #endif
9
10 #include "nsleep.h"
11
12
13
14 void
15 pm_sleep(unsigned int const milliseconds) {
16
17 #if MSVCRT
18 SleepEx(milliseconds, TRUE);
19 #else
20
21 /* We could use usleep() here if millisecond resolution is really
22 important, but since Netpbm has no need for it today, we don't
23 want to deal with the possibility that usleep() doesn't exist.
24 08.08.01.
25 */
26
27 sleep((milliseconds + 999)/1000);
28 #endif
29 }