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

Switch Clock to BigInt and fix monotonicity #175

Merged
merged 3 commits into from
Jun 13, 2021
Merged

Switch Clock to BigInt and fix monotonicity #175

merged 3 commits into from
Jun 13, 2021

Conversation

albe
Copy link
Owner

@albe albe commented Jun 12, 2021

Due to reduction of accuracy of the hrtime based clock to microseconds, the clock was no longer monotonic.

This fixes that, makes use of hrtime.bigint() (see #72 (comment)) and removes the decimal-encoded clock accuracy, which was not preserved for high clock ticks anyway (only up to ~30 years, which is likely still sufficient, but not guaranteed).

Also, this adds tests for the Clock to verify monotonicity and that it can cover at minimum 100 years (from it's epoch into the future).

@albe albe added the bug label Jun 12, 2021
@coveralls
Copy link

coveralls commented Jun 13, 2021

Coverage Status

Coverage increased (+0.05%) to 97.956% when pulling d94591e on clock-fixes into 401c9d2 on main.

@albe albe merged commit c5fb8df into main Jun 13, 2021
@albe albe deleted the clock-fixes branch June 13, 2021 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants