diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:38:28 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:38:28 +0000 |
commit | 367c9cb514c9da766488b9bdb218a18e31cb7624 (patch) | |
tree | f9e343be94161a4837f0f1c1d072a35538ae0f63 /lib/util/nsleep.c | |
parent | 6e88e3326cb0c7f7975b56189278cab3f84ba1bd (diff) | |
download | netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.gz netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.xz netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.zip |
Promote Stable (10.47) to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2691 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/util/nsleep.c')
-rw-r--r-- | lib/util/nsleep.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/util/nsleep.c b/lib/util/nsleep.c new file mode 100644 index 00000000..943b8c77 --- /dev/null +++ b/lib/util/nsleep.c @@ -0,0 +1,27 @@ +#ifdef WIN32 + #include <windows.h> + #include <process.h> +#else + #include <unistd.h> +#endif + +#include "nsleep.h" + + + +void +sleepN(unsigned int const milliseconds) { + +#ifdef WIN32 + SleepEx(milliseconds, TRUE); +#else + + /* We could use usleep() here if millisecond resolution is really + important, but since Netpbm has no need for it today, we don't + want to deal with the possibility that usleep() doesn't exist. + 08.08.01. + */ + + sleep((milliseconds + 999)/1000); +#endif +} |