pub trait Duration: PartialOrd<Self> + Debug + Default + Copy + Clone + Add<Self, Output = Self> {
    fn from_millis(millis: u32) -> Option<Self>;
    fn as_secs(&self) -> u64;
    fn subsec_nanos(&self) -> u32;
}
Expand description

A duration created from the difference between two instants

Required methods

Creates a duration from a number of milliseconds

This function returns None if this duration type cannot represent the provided number of milliseconds.

Returns the number of whole seconds in this duration, rounded down

Returns the fractional part of this duration in nanoseconds

Implementors