Function tiny_bench::bench

source ·
pub fn bench<T, F: FnMut() -> T>(closure: F)
Expand description

Will run the closure and print statistics from the benchmarking to stdout. Will persist results under the anonymous label which is shared, making comparisons impossible if running more than one (different) benchmark on the same project, ie. benching two different functions

use tiny_bench::bench;
bench(|| {
    // Some code that should be benched
})