-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partial workaround for timer during a clock jump
`time.Now()` uses the wall-clock and therefore calling it twice, one second apart, can produce quite different results (negative results but also a difference greater than one second). Go doesn't expose a monotonic clock, therefore, it's difficult to properly fix (but there is https://github.com/gavv/monotime if we want a proper fix for `timer.Time()`). This workaround just discard any non-positive duration.
- Loading branch information
1 parent
1f30fe9
commit 2e2529e
Showing
2 changed files
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters