mirror of https://github.com/shirou/gopsutil
[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()`.pull/1397/head
parent
2fb67aaf4a
commit
a5ecb9bca5
Loading…
Reference in New Issue