diff --git a/Cargo.toml b/Cargo.toml index 95862ed..1d2717e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,4 +35,4 @@ hdrhistogram = "7.5.2" quickcheck = "1.0.3" regex = "1.8.1" tempfile = "3.5.0" -chrono = "0.4.24" +chrono = "0.4.31" diff --git a/examples/bench.rs b/examples/bench.rs index c415d0a..7383b15 100644 --- a/examples/bench.rs +++ b/examples/bench.rs @@ -42,7 +42,9 @@ fn main() { } pub fn precise_time_ns() -> u64 { - chrono::offset::Utc::now().timestamp_nanos() as u64 + chrono::offset::Utc::now() + .timestamp_nanos_opt() + .expect("timestamp after year 2262") as u64 } fn format_duration(n: u64) -> String {