pub fn measure<F>(f: F) -> Secondswhere
F: FnOnce(),Expand description
Measure the amount of time the given function takes to execute
Time is measured in floating-point number of seconds
ยงExample
use eggtimer::measure;
let elapsed = measure(|| {
for i in 0..1000 {
println!("{}", i);
}
});
println!("Printing all those numbers took {} seconds", elapsed);