> module
std::time
timing, durations and sleep
use std::time; feature time in the browser (in-memory)
std::time provides monotonic timing with Instant and Duration, plus a sleep function.
> functions
A duration of secs seconds, which may be fractional. A negative or non-finite number is a runtime error.
> types
> functions
A Duration prints in the largest unit that is at least 1, such as 1.234s, 42ms, 100µs or 500ns.
> examples
use std::io;
use std::time;
fn main() {
let start = time::now();
time::sleep(time::from_millis(20));
let elapsed = start.elapsed();
io::println("took {}", elapsed);
io::println("{} ms", elapsed.millis());
}