1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::time::Duration;
use tiny_bench::Timeable;

pub fn main() {
    let v = (0..100)
        .inspect(|_a| {
            my_expensive_call();
        })
        .timed()
        .max();
    assert_eq!(99, v.unwrap());
}

fn my_expensive_call() {
    std::thread::sleep(Duration::from_millis(5));
}