Mojo function
run
run[func: fn() raises -> None](max_iters: Int = 1000000000, min_runtime_secs: SIMD[float64, 1] = SIMD(2), max_runtime_secs: SIMD[float64, 1] = SIMD(60), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_time_ns' has elapsed and either
max_time_ns
OR max_iters
is achieved.
Parameters:
- func (
fn() raises -> None
): The function to benchmark.
Args:
- max_iters (
Int
): Max number of iterations to run (default1_000_000_000
). - min_runtime_secs (
SIMD[float64, 1]
): Upper bound on benchmarking time in secs (default2
). - max_runtime_secs (
SIMD[float64, 1]
): Lower bound on benchmarking time in secs (default60
). - max_batch_size (
Int
): The maximum number of iterations to perform per time measurement.
Returns:
Average execution time of func in ns.
run[func: fn() -> None](max_iters: Int = 1000000000, min_runtime_secs: SIMD[float64, 1] = SIMD(2), max_runtime_secs: SIMD[float64, 1] = SIMD(60), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_time_ns' has elapsed and either
max_time_ns
OR max_iters
is achieved.
Parameters:
- func (
fn() -> None
): The function to benchmark.
Args:
- max_iters (
Int
): Max number of iterations to run (default1_000_000_000
). - min_runtime_secs (
SIMD[float64, 1]
): Upper bound on benchmarking time in secs (default2
). - max_runtime_secs (
SIMD[float64, 1]
): Lower bound on benchmarking time in secs (default60
). - max_batch_size (
Int
): The maximum number of iterations to perform per time measurement.
Returns:
Average execution time of func in ns.
run[: origin.set, //, func: fn() raises capturing -> None](max_iters: Int = 1000000000, min_runtime_secs: SIMD[float64, 1] = SIMD(2), max_runtime_secs: SIMD[float64, 1] = SIMD(60), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_time_ns' has elapsed and either
max_time_ns
OR max_iters
is achieved.
Parameters:
- func (
fn() raises capturing -> None
): The function to benchmark.
Args:
- max_iters (
Int
): Max number of iterations to run (default1_000_000_000
). - min_runtime_secs (
SIMD[float64, 1]
): Upper bound on benchmarking time in secs (default2
). - max_runtime_secs (
SIMD[float64, 1]
): Lower bound on benchmarking time in secs (default60
). - max_batch_size (
Int
): The maximum number of iterations to perform per time measurement.
Returns:
Average execution time of func in ns.
run[: origin.set, //, func: fn() capturing -> None](max_iters: Int = 1000000000, min_runtime_secs: SIMD[float64, 1] = SIMD(2), max_runtime_secs: SIMD[float64, 1] = SIMD(60), max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_time_ns' has elapsed and either
max_time_ns
OR max_iters
is achieved.
Parameters:
- func (
fn() capturing -> None
): The function to benchmark.
Args:
- max_iters (
Int
): Max number of iterations to run (default1_000_000_000
). - min_runtime_secs (
SIMD[float64, 1]
): Upper bound on benchmarking time in secs (default2
). - max_runtime_secs (
SIMD[float64, 1]
): Lower bound on benchmarking time in secs (default60
). - max_batch_size (
Int
): The maximum number of iterations to perform per time measurement.
Returns:
Average execution time of func in ns.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!