Function tiny_bench::run_timed_times
source · pub fn run_timed_times<T, F: FnMut() -> T>(
iterations: usize,
closure: F
) -> TimingData
Expand description
Runs some closure n
times and returns the data gathered
use std::time::Duration;
use tiny_bench::run_timed_times;
let data = run_timed_times(100, || std::thread::sleep(Duration::from_micros(1)));
data.pretty_print();