Struct cap_async_std::time::SystemClock [−][src]
pub struct SystemClock(_);
A reference to a system clock, useful for talking to external entities like the file system or other processes.
This does not directly correspond to anything in std, however its methods
correspond to methods in std::time::SystemTime.
Implementations
impl SystemClock[src]
impl SystemClock[src]pub const UNIX_EPOCH: SystemTime[src]
pub const UNIX_EPOCH: SystemTime[src]An anchor in time which can be used to create new SystemTime
instances or learn about where in time a SystemTime lies.
This corresponds to std::time::SystemTime::UNIX_EPOCH.
pub const unsafe fn new() -> SystemClock[src]
pub const unsafe fn new() -> SystemClock[src]Constructs a new instance of Self.
Safety
This is unsafe because access to clocks is an ambient authority.
pub fn now(&self) -> SystemTime[src]
pub fn now(&self) -> SystemTime[src]Returns an instant corresponding to “now”.
This corresponds to std::time::SystemTime::now.
pub fn elapsed(
&self,
system_time: SystemTime
) -> Result<Duration, SystemTimeError>[src]
pub fn elapsed(
&self,
system_time: SystemTime
) -> Result<Duration, SystemTimeError>[src]Returns the amount of time elapsed since this instant was created.
This corresponds to std::time::SystemTime::elapsed.