RFC: Time Library 0.2

Bulat Ziganshin bulatz at HotPOP.com
Tue Nov 1 10:13:04 EST 2005


Hello Sebastian,

Tuesday, November 01, 2005, 5:21:44 PM, you wrote:

SS> I sometimes need wall-clock time with very high precision. To meassure

i use the following:

diffTimes (TOD sa pa) (TOD sb pb)  =  fromIntegral(sa - sb) + (fromIntegral(pa-pb) / 1e12)

-- Number of seconds since oprogram start
return_real_secs = do
  start_time    <- readIORef refClockTimeAtProgramStart
  current_time  <- getClockTime
  return $ diffTimes current_time start_time


of course, it's a hack using internal details of current library and i
also need the function which will return high-precision wall-clock
time

-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Libraries mailing list