Time Resolution

Ketil Malde ketil+haskell at ii.uib.no
Mon Jan 31 06:31:18 EST 2005


It might be nice to have an overloaded TimeDiff:

   class TimeDiff a where
      diff :: TimeStamp -> TimeStamp -> a

   instance TimeDiff Double where...
   instance TimeDiff Integer where...

with the difference being seconds.

So if I'm working on a fine scale, I could use the Double instance
(and remember to check the timer resolution), while on a greater
scale, I could get an unlimited and accurate Integer number of
seconds. 

(It would also be nice if two different invocations of getTimeStamp
would always return different values, but that is perhaps difficult to
implement/guarantee?)

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants



More information about the Libraries mailing list