[][src]Trait sgx_tstd::untrusted::time::SystemTimeEx

pub trait SystemTimeEx {
    fn now() -> SystemTime;
fn elapsed(&self) -> Result<Duration, SystemTimeError>; }

Required methods

fn now() -> SystemTime

fn elapsed(&self) -> Result<Duration, SystemTimeError>

Loading content...


impl SystemTimeEx for SystemTime[src]

fn now() -> SystemTime[src]

Returns the system time corresponding to "now".

fn elapsed(&self) -> Result<Duration, SystemTimeError>[src]

Returns the amount of time elapsed since this system time was created.

This function may fail as the underlying system clock is susceptible to drift and updates (e.g. the system clock could go backwards), so this function may not always succeed. If successful, Ok(Duration) is returned where the duration represents the amount of time elapsed from this time measurement to the current time.

Returns an Err if self is later than the current system time, and the error contains how far from the current system time self is.

Loading content...