Instance Propertypackage-benchmark 1.27.2Benchmark
teardown
Optional per-benchmark specific teardown done after final run is done
Benchmark.swift:410var teardown: BenchmarkTeardownHook?
Other members in extension
Type members
Instance members
var maxDuration: Duration
The maximum wall clock runtime for the benchmark, currenty defaults to
.seconds(1)
if not setvar maxIterations: Int
The maximum number of iterations for the benchmark., currently defaults to 10K iterations if not set
var metrics: [BenchmarkMetric]
Defines the metrics that should be measured for the benchmark
var scalingFactor: BenchmarkScalingFactor
Specifies the number of logical subiterations being done, supporting scaling of metrics accordingly. E.g.
.kilo
will scale results with 1000. Any subiteration done in the benchmark should usefor _ in benchmark.scaledIterations
for the number of iterations.var setup: BenchmarkSetupHook?
Optional per-benchmark specific setup done before warmup and all iterations
var skip: Bool
Whether to skip this test (convenience for not having to comment out tests that have issues)
var thresholds: [BenchmarkMetric : BenchmarkThresholds]?
Customized threshold tolerances for a given metric for the Benchmark used for checking for regressions/improvements/equality.
var timeUnits: BenchmarkTimeUnits
Override the automatic detection of timeunits for metrics related to time to a specific one (auto should work for most use cases)
var warmupIterations: Int
Specifies a number of warmup iterations should be performed before the measurement to reduce outliers due to e.g. cache population