pub struct PreciseTime(_);
An opaque structure representing a moment in time.
The only operation that can be performed on a PreciseTime
is the
calculation of the Duration
of time that lies between them.
Repeatedly call a function for 1 second:
use time::{Duration, PreciseTime};
let start = PreciseTime::now();
while start.to(PreciseTime::now()) < Duration::seconds(1) {
do_some_work();
}
Returns a PreciseTime
representing the current moment in time.
Returns a Duration
representing the span of time from the value of
self
to the value of later
.
If later
represents a time before self
, the result of this method
is unspecified.
If later
represents a time more than 293 years after self
, the
result of this method is unspecified.
Performs copy-assignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static