Skip to content

Commit

Permalink
Fix use of deprecated function in chrono
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Sep 25, 2023
1 parent 62ecb19 commit 0c2d050
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 3 additions & 1 deletion examples/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0c2d050

Please sign in to comment.