mirror of
https://github.com/haileys/bark
synced 2025-03-16 22:57:00 +00:00
use CLOCK_MONOTONIC_RAW instead of CLOCK_BOOTTIME
This commit is contained in:
parent
5ea6a9ef6c
commit
0a555d4883
1 changed files with 2 additions and 2 deletions
|
@ -4,8 +4,8 @@ use nix::time::ClockId;
|
|||
use bark_protocol::types::TimestampMicros;
|
||||
|
||||
pub fn now() -> TimestampMicros {
|
||||
let timespec = nix::time::clock_gettime(ClockId::CLOCK_BOOTTIME)
|
||||
.expect("clock_gettime(CLOCK_BOOTTIME) failed, are we on Linux?");
|
||||
let timespec = nix::time::clock_gettime(ClockId::CLOCK_MONOTONIC_RAW)
|
||||
.expect("clock_gettime(CLOCK_MONOTONIC_RAW) failed, are we on Linux?");
|
||||
|
||||
let micros = u64::try_from(timespec.num_microseconds())
|
||||
.expect("cannot convert i64 time value to u64");
|
||||
|
|
Loading…
Add table
Reference in a new issue