Closed DeamonDev closed 1 year ago
Integer picoseconds is the internal representation of the DiffTime
type, that's the only reason for diffTimeToPicoseconds
. Milliseconds and microseconds would not be integers.
Okay, good point. But what about taking a floor
function over the resulting fractional?
@edit
The quot
function is taking care of that.
I would prefer to avoid the proliferation of trivial functions.
There is only one function which converts
DiffTime
into numeric value which isdiffTimeToPicoseconds
. I don't see any reason to distinguish picoseconds from the other time measurement units. Lot of other libs in the Haskell's ecosystem accepts microseconds (e.g.threadDelay
fromControl.Concurrent
). Of course it is very easy to do the conversions on its own, but I think we should pull this out in front of the parentheses (and it is the right place to do so). My proposal is to add two other conversions which arediffTimeToMicroseconds
anddiffTimeToMilliseconds
.