Idris2/tests/refc/clock/TestClock.idr
2021-05-20 14:25:16 +01:00

26 lines
585 B
Idris

module TestClock
import System.Clock
clockSmall : Clock type -> Bool
clockSmall (MkClock {type} s n) = MkClock {type} s n < MkClock 1 0
clockBig : Clock type -> Bool
clockBig (MkClock {type} s n) = MkClock {type} s n > MkClock 1600000000 0
main : IO ()
main = do
utc <- clockTime UTC
monotonicStart <- clockTime Monotonic
process <- clockTime Process
thread <- clockTime Thread
monotonicEnd <- clockTime Monotonic
putStrLn $ show $ [
clockBig utc,
monotonicStart < monotonicEnd,
clockSmall process,
clockSmall thread
]