Function simple_benchmark

Source
pub fn simple_benchmark<U, F: FnOnce() -> U>(f: F)
Available on crate feature std only.
Expand description

Runs the given function and prints the elapsed time. It supports stable Rust.

§Example

fn bench_foo() {
  testutils::simple_benchmark(|| {
    foo() // Your code here...
  })
}