Defines a monotonic clock whose values are instances of Duration
.
Why not std::time::Instant
?
Instant
is opaque and cannot be serialized.
Example
let mut clock = new;
let t0 = clock.elapsed;
let sleep_duration = from_millis;
sleep;
let t1 = clock.elapsed;
assert!;