hpath/unix/tests/libposix/posix006.hs
2020-04-14 11:29:56 +02:00

19 lines
544 B
Haskell

import System.Posix.Time
import System.Posix.Unistd
import System.Posix.Signals
main = do start <- epochTime
blockSignals reservedSignals -- see #4504
sleep 1
finish <- epochTime
let slept = finish - start
if slept >= 1 && slept <= 2
then putStrLn "OK"
else do putStr "Started: "
print start
putStr "Finished: "
print finish
putStr "Slept: "
print slept