benchmark(const Action func, integer iterations) -> BenchmarkResult
Benchmarks a function by running it a specified number of times and collecting timing statistics.
Parameters
- func: The function to benchmark.
- iterations: The number of times to execute the function.