Skip to main content

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

NameDescription
bestReturns the best (fastest) time for a single iteration.
meanReturns the mean time per iteration.
stddevReturns the standard deviation of execution times across all iterations.
totalReturns the total time taken for all benchmark iterations.
worstReturns the worst (slowest) time for a single iteration.