Use threadDelay instead of sleep, as suggested by GHC.