On 8 April 2011 22:48, Warren Harris <[email protected]> wrote:
> I'm trying out GHC-7.0.3-x86_64 for Mac OS X and see what seems to be a bug 
> in System.Time.diffClockTimes. The TimeDiff tdPicosec field returns values 
> that seem to jump around erratically

Strange. This doesn't happen on my Ubuntu x86_64:

*Main> testOLD
TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0,
tdSec = 0, tdPicosec = 3000000}
*Main> testOLD
TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0,
tdSec = 0, tdPicosec = 5000000}
*Main> testOLD
TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0,
tdSec = 0, tdPicosec = 5000000}
*Main> testOLD
TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0,
tdSec = 0, tdPicosec = 6000000}
*Main> testOLD
TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0,
tdSec = 0, tdPicosec = 6000000}

I also tried with the new time library but that also works as expected:

import Data.Time

test = do
  startTime <- getCurrentTime
  endTime   <- getCurrentTime
  let dt = diffUTCTime endTime startTime
  putStrLn $ show dt

*Main> test
0.000006s
*Main> test
0.000007s
*Main> test
0.000006s
*Main> test
0.000004s
*Main> test
0.000007s

Bas

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to