-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to monotonic time for duration calculations (#857)
Drops the use of `Time.now` in favor of using the system's monotonic clock for various operations that calculate and use elapsed duration. The latter is preferable because in some cases `Time.now` can be unstable, like if it's set manually by a system administrator or an NTP daemon. I don't expect that the previous code would actually have caused trouble in the vast majority of normal situations, so I'm not going to backport anything, but this seems like good hygiene. For better or worse I had to wrap the monotonic time calls in a new `Util` function because (1) the normal invocation is long enough to have caused a lot of overruns on our 80 character line lengths, and (2) Timecop doesn't stub the monotonic clock, so the `Util` method gives us a nice place that we can stub on where necessary.
- Loading branch information
1 parent
f2b1fa1
commit 480303c
Showing
5 changed files
with
84 additions
and
61 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
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
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