From 98c3a9174b16c68a9b2a8f196418425c152b632c Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 7 Jan 2004 12:43:50 +0000 Subject: [PATCH] [project @ 2004-01-07 12:43:50 by simonmar] Mention that threadDelay rounds its argument down to a multiple of 0.02s. --- GHC/Conc.lhs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index 2a24fa5..d30513d 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -271,13 +271,19 @@ specified file descriptor is available for reading (just like select). @threadWaitWrite@ is similar, but for writing on a file descriptor. \begin{code} --- |The 'threadDelay' operation will cause the current thread to --- suspend for a given number of microseconds (GHC only). +-- | Suspends the current thread for a given number of microseconds +-- (GHC only). +-- +-- Note that the resolution used by the Haskell runtime system's +-- internal timer is 1\/50 second, and 'threadDelay' will round down +-- its argument to the nearest multiple of this resolution. In +-- particular, to get the smallest non-zero delay, pass 20000 as the +-- parameter to 'threadDelay'. +-- +-- There is no guarantee that the thread will be rescheduled promptly +-- when the delay has expired, but the thread will never continue to +-- run /earlier/ than specified. -- --- Note that the resolution --- used by the Haskell runtime system\'s internal timer together with the --- fact that the thread may take some time to be rescheduled after the --- time has expired, means that the accuracy is more like 1\/50 second. threadDelay :: Int -> IO () -- | Block the current thread until data is available to read on the -- 1.7.10.4