-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[host] windows: use millisecond precision for BootTime()
Previously, system uptime is truncated to seconds, and then the subtraction from `time.Now()` is performed. Because uptime does not roll over to the next second at the same instant as `time.Now()`, then `BootTime()` ends up not being precise, and often varies by 1 second. This commit does the subtraction before truncating to seconds, which results in a significantly lower chance of variance in `BootTime()`.
- Loading branch information
1 parent
2fb67aa
commit a5ecb9b
Showing
2 changed files
with
15 additions
and
3 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