Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DiffTime instead of NominalDiffTime #27

Open
nikita-volkov opened this issue Jan 12, 2016 · 3 comments
Open

Use DiffTime instead of NominalDiffTime #27

nikita-volkov opened this issue Jan 12, 2016 · 3 comments

Comments

@nikita-volkov
Copy link

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.

@BardurArantsson
Copy link

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.)

@RobertFischer
Copy link

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

@BardurArantsson
Copy link

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants