This module makes the operations exported by
available on all platforms. On POSIX systems it re-exports operations from
System.Posix.Unistd, on other platforms it emulates the operations as far
Sleep for the specified duration (in seconds). Returns the time remaining (if the sleep was interrupted by a signal, for example).
threadDelay is a better choice. Since GHC
uses signals for its internal clock, a call to
sleep will usually be
interrupted immediately. That makes
sleep unusable in a program compiled
with GHC, unless the RTS timer is disabled (with
+RTS -V0). Furthermore,
sleep will block all other user threads.
Even with the
sleep requires a full OS thread to
threadDelay has none of these shortcomings.