资 源 简 介
HS.Benchmark provides benchmarking utilities for .NET code.
There are two benchmark running interfaces. One is used for benchmarking in the foreground, one for the background (tests are run in a separate thread).
Usage looks like this:
```
using (var benchmark = BackgroundBenchmark.Create(MaxTimePerTrial, FinishedAction))
{
benchmark.Add
(
"Recursive",
() => TimeWasters.RecursiveFibonacci(Max),
summaryResultsCollector.AddResult,
intermediateResultsCollector.AddResult
);
benchmark.Add
(
"Iterative",
() => TimeWasters.IterativeFibonacci(Max).IterateToEnd(),
summaryResultsCollector.AddResult,
intermediateResultsCollector.AddResult
);
benchmark.Begin();
}
```