pool icon indicating copy to clipboard operation
pool copied to clipboard

Use DiffTime instead of NominalDiffTime

Open nikita-volkov opened this issue 10 years ago • 3 comments

The NominalDiffTime type is intended for manipulation of universal dates, and it does not always represent the same interval of time. The timeout values on the other hand require exactly an interval of time, which is the case in this library. Such values should be represented by the DiffTime type.

nikita-volkov avatar Jan 12 '16 08:01 nikita-volkov

Why use either? Why not just specify using a simple Word64? Seems rather excessive to incur a dependency for just (Nominal)DiffTime?

(I'm obviously assuming that there's some way of getting at the system's monotonic clock.)

BardurArantsson avatar Feb 11 '16 18:02 BardurArantsson

What's the issue with a dependency in order to be more expressive in your type system by using a de facto standard?

RobertFischer avatar May 01 '17 01:05 RobertFischer

How is it more expressive? AFAICT (Nominal)DiffTime even allow negative values -- which is utterly nonsensical for timeouts.

(Also, there are other time libraries, though they usually themselves end up having to depend on time itself. Given the above I just don't it makes sense to have the dependency. That's all.)

BardurArantsson avatar May 02 '17 15:05 BardurArantsson