Trait crossbus::time::Timing

source ·
pub trait Timingwhere
    Self: Add<Duration, Output = Self> + Sub<Duration, Output = Self> + AddAssign<Duration> + SubAssign<Duration> + Unpin + Clone + PartialEq + Eq + Ord + PartialOrd + Hash + Debug,{
    // Required methods
    fn now() -> Self;
    fn duration_since(&self, other: &Self) -> Duration;
    fn as_secs_f64(&self) -> f64;
}
Available on crate feature time only.
Expand description

An abstraction for to enable Actor known time

Required Methods§

source

fn now() -> Self

Returns an instant corresponding to “now”.

source

fn duration_since(&self, other: &Self) -> Duration

Returns the amount of time elapsed from another instant to this one, or zero duration if that instant is later than this one.

source

fn as_secs_f64(&self) -> f64

Available on crate features time-metric and unstable only.

Returns the number of seconds contained as f64.

Implementors§

source§

impl Timing for Clock

Available on crate feature std only.