Struct cap_primitives::time::MonotonicClock [−][src]
pub struct MonotonicClock(_);
A reference to a monotonically nondecreasing clock.
This does not directly correspond to anything in std
, however its methods
correspond to methods in std::time::Instant
.
Implementations
impl MonotonicClock
[src]
impl MonotonicClock
[src]pub const unsafe fn new() -> Self
[src]
pub const unsafe fn new() -> Self
[src]Constructs a new instance of Self
.
Safety
This is unsafe because access to clocks is an ambient authority.
pub fn now(&self) -> Instant
[src]
pub fn now(&self) -> Instant
[src]Returns an instant corresponding to “now”.
This corresponds to std::time::Instant::now
.
pub fn elapsed(&self, instant: Instant) -> Duration
[src]
pub fn elapsed(&self, instant: Instant) -> Duration
[src]Returns the amount of time elapsed since this instant was created.
This corresponds to std::time::Instant::elapsed
.