Enum delta::Timer
[−]
[src]
pub enum Timer { NotStarted, Started { last_marked: DateTime<Utc>, }, }
A timer.
Variants
NotStarted
The timer has not been started yet.
Started
The timer has been started.
Fields of Started
last_marked: DateTime<Utc> | The time when the timer was last marked. |
Methods
impl Timer
[src]
fn new() -> Self
[src]
Creates a new timer.
fn mark(&mut self) -> Duration
[src]
Marks a new instant, returning the number of seconds since the last mark.
The very first mark will return a delta time of 0.0
. Because of this,
any time between timer creation and the first mark will have no affect
on the delta times returned.
fn mark_millis(&mut self) -> u64
[src]
Marks a new instant, returning the number of milliseconds since the last mark.
fn mark_secs(&mut self) -> f64
[src]
Marks a new instant, returning the number of seconds since the last mark.
The value returned is fractional - if 1 millisecond has passed, then
0.001
will be returned.
Trait Implementations
impl Copy for Timer
[src]
impl Clone for Timer
[src]
fn clone(&self) -> Timer
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Timer
[src]
impl PartialEq for Timer
[src]
fn eq(&self, __arg_0: &Timer) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Timer) -> bool
[src]
This method tests for !=
.
impl Eq for Timer
[src]
impl PartialOrd for Timer
[src]
fn partial_cmp(&self, __arg_0: &Timer) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Timer) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Timer) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Timer) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Timer) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Timer
[src]
fn cmp(&self, __arg_0: &Timer) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more