Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update readme to fix broken example benchmark #299

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -107,7 +117,7 @@ let benchmarks = {
for await _ in taskGroup {
}
})
}
}
}
```

Expand Down
Loading