Function easybench::bench_env [] [src]

pub fn bench_env<F, I, O>(env: I, f: F) -> Stats where F: Fn(&mut I) -> O, I: Clone

Run a benchmark with an environment.

The value env is a clonable prototype for the "benchmark environment". Each iteration receives a freshly-cloned mutable copy of this environment. The time taken to clone the environment is not included in the results.

Nb: it's very possible that we will end up allocating many (>10,000) copies of env at the same time. Probably best to keep it small.

See bench and the module docs for more.