dotnet/BenchmarkDotNet

Add CancellationToken support on non-async benchmark runner APIs

Closed

#3,204 opened on Jul 22, 2026

 (4 comments) (0 reactions) (1 assignee)C# (1,062 forks)batch import
good first issueup-for-grabs

Repository metrics

Stars
 (11,464 stars)
PR merge metrics
 (Avg merge 5d 9h) (20 merged PRs in 30d)

Description

Currently BenchmarkDotNet support CancellationToken on Async APIs.

It's also desirable to support CancellationToken on non-async APIs also on BenchmarkSwitcher/BenchmarkRunner.

Expected usage Use xUnit.v3's TestContext.Current.CancellationToken to run benchmarks. Without

Contributor guide