Cargo Bench Iterations for Macro Benchmark

I'm wondering if it is possible to use #[bench] for macro benchmarks.

When using bencher.iter(|| {}) and cargo bench then I assume it uses auto_bench. Considering a benchmark taking 20 seconds, it will run this (1+50+250)=301 times. This means it takes about 100 minutes for this task.

I would like to constrain the benchmark to execute the method e.g. 3 times. Is this possible?

3 Likes