diff --git a/Tests/CommandKitTests/PerformanceTests.swift b/Tests/CommandKitTests/PerformanceTests.swift index c9b2709..c6f139e 100644 --- a/Tests/CommandKitTests/PerformanceTests.swift +++ b/Tests/CommandKitTests/PerformanceTests.swift @@ -7,11 +7,18 @@ import Testing /// measures, so they catch an accidental quadratic loop without flaking on a busy CI runner. @Suite(.serialized) struct PerformanceTests { + /// The mean of the fastest of five batches. Other work on the machine can only slow a batch down, never + /// speed it up, so the fastest batch is the closest to the code's own cost. An average over everything + /// let one busy moment fail the gate on a loaded Mac. func averageMicroseconds(_ iterations: Int, _ body: () -> Void) -> Double { body() - let start = DispatchTime.now().uptimeNanoseconds - for _ in 0..