Skip to content

Commit

Permalink
div-ceil (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored Oct 1, 2024
1 parent a4f7fa4 commit f48e67d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod convert {
/// million years.
pub fn millis(duration: Duration) -> u64 {
// Round up.
let millis = (duration.subsec_nanos() + NANOS_PER_MILLI - 1) / NANOS_PER_MILLI;
let millis = duration.subsec_nanos().div_ceil(NANOS_PER_MILLI);
duration
.as_secs()
.saturating_mul(MILLIS_PER_SEC)
Expand Down

0 comments on commit f48e67d

Please sign in to comment.