
I'm on 6.10.1, using the libs provided with the binary of GHC for Mac OS X. I was fooling around with the time package in GHCi and something seems to be off. I have included a transcript. If I take a time diff, then the seconds are positive when the picos are negative and vice versa. -- _jsn |...transcript...| Prelude System.Time> :m + System.Time Prelude System.Time> t0 <- System.Time.getClockTime Prelude System.Time> t1 <- System.Time.getClockTime Prelude System.Time> diffClockTimes t0 t1 TimeDiff { tdYear = 0 , tdMonth = 0 , tdDay = 0 , tdHour = 0 , tdMin = 0 , tdSec = -7 , tdPicosec = 238846000000 } Prelude System.Time> diffClockTimes t1 t0 TimeDiff { tdYear = 0 , tdMonth = 0 , tdDay = 0 , tdHour = 0 , tdMin = 0 , tdSec = 7 , tdPicosec = -238846000000 }

I can't find document for System.Time .
But I can import System.Time . It's weird...
I can't find document for TimeDiff and related functions. I guess this
is all deprecated.
A related bug report: http://hackage.haskell.org/trac/ghc/ticket/2519
I would use Data.Time.Clock
Prelude> :m + Data.Time.Clock
Prelude Data.Time.Clock> getCurrentTime
Prelude Data.Time.Clock> t0 <- getCurrentTime
Prelude Data.Time.Clock> t1 <- getCurrentTime
Prelude Data.Time.Clock> t0
Prelude Data.Time.Clock> diffUTCTime t0 t1
-2.912s
Prelude Data.Time.Clock> diffUTCTime t1 t0
2.912s
Prelude Data.Time.Clock> :t diffUTCTime t1 t0
diffUTCTime t1 t0 :: NominalDiffTime
On Mon, Dec 1, 2008 at 10:05 PM, Jason Dusek
I'm on 6.10.1, using the libs provided with the binary of GHC for Mac OS X. I was fooling around with the time package in GHCi and something seems to be off. I have included a transcript.
If I take a time diff, then the seconds are positive when the picos are negative and vice versa.
-- _jsn
|...transcript...|
Prelude System.Time> :m + System.Time Prelude System.Time> t0 <- System.Time.getClockTime Prelude System.Time> t1 <- System.Time.getClockTime Prelude System.Time> diffClockTimes t0 t1 TimeDiff { tdYear = 0 , tdMonth = 0 , tdDay = 0 , tdHour = 0 , tdMin = 0 , tdSec = -7 , tdPicosec = 238846000000 } Prelude System.Time> diffClockTimes t1 t0 TimeDiff { tdYear = 0 , tdMonth = 0 , tdDay = 0 , tdHour = 0 , tdMin = 0 , tdSec = 7 , tdPicosec = -238846000000 } _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Jason Dusek
-
sam lee