BenchmarkResult
Contains statistical results from benchmarking operations.
BenchmarkResult holds comprehensive timing statistics collected from running a function multiple times. It includes total execution time, mean time per iteration, best and worst execution times, and standard deviation. This data helps analyze performance characteristics and identify performance variations.
Example
var result = benchmark(fun() { /* some work */ }, 1000)
print(result)
// Or
print("Best time: ${result.best}")
print("Standard deviation: ${result.stddev}")
Members
| Name | Description |
|---|---|
| best | Returns the best (fastest) time for a single iteration. |
| mean | Returns the mean time per iteration. |
| stddev | Returns the standard deviation of execution times across all iterations. |
| total | Returns the total time taken for all benchmark iterations. |
| worst | Returns the worst (slowest) time for a single iteration. |