// This function assumes that the counted duration won't be too long.
This function assumes that the counted duration won't be too long.
This function assumes that the counted duration won ' t be too long .
fn saturating_duration_millis(d: &Duration) -> u64 {
    let d_secs = d.as_secs();
    if d_secs == 0 {
        d.subsec_millis() as u64
    } else {
        d_secs
            .saturating_mul(1000)
            .saturating_add(d.subsec_millis() as u64)
    }
}
fn saturating_duration_millis ( d : & Duration ) -> u64 { let d_secs = d . as_secs ( ) ; if d_secs == 0 { d . subsec_millis ( ) as u64 } else { d_secs . saturating_mul ( 1000 ) . saturating_add ( d . subsec_millis ( ) as u64 ) } }
This function assumes that the counted duration won't be too long.
This function assumes that the counted duration won ' t be too long .
d
&Duration