hpath/unix/tests/libposix/posix006.hs

19 lines
544 B
Haskell
Raw Permalink Normal View History

2020-04-14 09:27:28 +00:00
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