[][src]Function microbench::measure_setup

pub fn measure_setup<I, T>(
    options: &Options,
    setup: impl FnMut() -> I,
    f: impl FnMut(I) -> T
) -> Vec<Sample>

Measures the execution time of the supplied function ignoring setup time.

This function does not include the time it takes to execute the setup function in the measurements. This can be useful when you want to exclude the running time of some non-trivial setup which is needed for every execution of the supplied function. However, it should be noted that this function introduces a very small amount of overhead which will be reflected in the measurements (typically of the order of a few nanoseconds).

Warning: This function can potentially allocate very large amounts of memory. The memory option controls the maximum amount of memory this function is allowed to allocate.