Struct time::SteadyTime [] [src]

pub struct SteadyTime(_);

A structure representing a moment in time.

SteadyTimes are generated by a "steady" clock, that is, a clock which never experiences discontinuous jumps and for which time always flows at the same rate.

Examples

Repeatedly call a function for 1 second:

let start = SteadyTime::now();

while SteadyTime::now() - start < Duration::seconds(1) {
    do_some_work();
}

Methods

impl SteadyTime

fn now() -> SteadyTime

Returns a SteadyTime representing the current moment in time.

Trait Implementations

impl Display for SteadyTime

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Sub for SteadyTime

type Output = Duration

fn sub(self, other: SteadyTime) -> Duration

impl Sub<Duration> for SteadyTime

type Output = SteadyTime

fn sub(self, other: Duration) -> SteadyTime

impl Add<Duration> for SteadyTime

type Output = SteadyTime

fn add(self, other: Duration) -> SteadyTime

Derived Implementations

impl Debug for SteadyTime

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Eq for SteadyTime

impl PartialEq for SteadyTime

fn eq(&self, __arg_0: &SteadyTime) -> bool

fn ne(&self, __arg_0: &SteadyTime) -> bool

impl Ord for SteadyTime

fn cmp(&self, __arg_0: &SteadyTime) -> Ordering

impl PartialOrd for SteadyTime

fn partial_cmp(&self, __arg_0: &SteadyTime) -> Option<Ordering>

fn lt(&self, __arg_0: &SteadyTime) -> bool

fn le(&self, __arg_0: &SteadyTime) -> bool

fn gt(&self, __arg_0: &SteadyTime) -> bool

fn ge(&self, __arg_0: &SteadyTime) -> bool

impl Copy for SteadyTime

impl Clone for SteadyTime

fn clone(&self) -> SteadyTime

fn clone_from(&mut self, source: &Self)