Skip to main content

Module time

Module time 

Source
Available on crate feature full only.
Expand description

Temporal quantification.

§Examples

Using Instant to calculate how long a function took to run:

ⓘ
let now = Instant::now();

// Calling a slow function, it may take a while
slow_function();

let elapsed_time = now.elapsed();
println!("Running slow_function() took {} seconds.", elapsed_time.as_secs());

Structs§

Instant
A measurement of the current system time. Opaque and useful only with [Duration].