Ticket #2519: PicoTest2.hs

File PicoTest2.hs, 408 bytes (added by Ansible, 7 years ago)

PicoTest2.hs

Line 
1module Main
2  where
3
4import IO
5import Random
6import System.Time
7
8toSeconds :: ClockTime -> Double
9toSeconds (TOD x y) = 
10  fromInteger x +  (fromInteger y) / 1000000000000.0
11
12tdToSeconds :: TimeDiff -> Double
13tdToSeconds td = 
14 toSeconds (addToClockTime td (TOD 0 0))
15
16testTD = (diffClockTimes (TOD 1218999539 946978000000) (TOD 1218999540 931424000000))
17
18main = do
19 print testTD
20 print (tdToSeconds testTD)