[Haskell-cafe] bug in time libs?

Jason Dusek jason.dusek at gmail.com
Mon Dec 1 22:05:19 EST 2008


  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
           }


More information about the Haskell-Cafe mailing list