From df565c35aec8278275e68931fe34f7712abc433f Mon Sep 17 00:00:00 2001 From: lehtihet <60138988+lehtihet@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:18:20 +0100 Subject: [PATCH] Update readme to fix broken example benchmark. Fixes #295 --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 346d9f92..cf70f448 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,19 @@ let benchmarks = { // measure something here } + func defaultCounter() -> Int { + 10 + } + + func dummyCounter(_ count: Int) { + for index in 0 ..< count { + blackHole(index) + } + } + Benchmark("All metrics, full concurrency, async", configuration: .init(metrics: BenchmarkMetric.all, - maxDuration: .seconds(10)) { benchmark in + maxDuration: .seconds(10))) { benchmark in let _ = await withTaskGroup(of: Void.self, returning: Void.self, body: { taskGroup in for _ in 0..<80 { taskGroup.addTask { @@ -107,7 +117,7 @@ let benchmarks = { for await _ in taskGroup { } }) - } + } } ```