I am developing some benchmarks for a crate using criterion (cargo bench). I would like to temporarily limit the amount of iterations until I finish the code.
I know measurements may not be precise, but this is just temporary. Is this possible?
I am developing some benchmarks for a crate using criterion (cargo bench). I would like to temporarily limit the amount of iterations until I finish the code.
I know measurements may not be precise, but this is just temporary. Is this possible?
Copyright © 2021 Jogjafile Inc.
It is possible.
Look at the Criterion Benchmark. There you can find methods relevant to you, specifically
measurement_time.Digging deeper, you can find how to use them here:
Where
measurement_time(Duration::from_millis(1000))is the droid you're looking for. This effectively dropped the number of iterations for my specific function by 80%.