diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-09-05 18:38:29 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-09-05 18:38:29 -0500 |
| commit | 0c3bb7fe5688aa4cd3c7e2464dadcb51ad59ac20 (patch) | |
| tree | c93d1525237907f0018776e0e285ec51a61a6405 /tests/slskd.Tests.Benchmarks/HelloWorld.cs | |
| parent | 2602fb0e821d9af36d917d2f54d071f5d00e144f (diff) | |
| download | slskd-0c3bb7fe5688aa4cd3c7e2464dadcb51ad59ac20.tar.gz | |
add benchmark scaffolding
Diffstat (limited to 'tests/slskd.Tests.Benchmarks/HelloWorld.cs')
| -rw-r--r-- | tests/slskd.Tests.Benchmarks/HelloWorld.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/slskd.Tests.Benchmarks/HelloWorld.cs b/tests/slskd.Tests.Benchmarks/HelloWorld.cs new file mode 100644 index 00000000..21b93d57 --- /dev/null +++ b/tests/slskd.Tests.Benchmarks/HelloWorld.cs @@ -0,0 +1,29 @@ +namespace slskd.Tests.Benchmarks +{ + using BenchmarkDotNet.Attributes; + using BenchmarkDotNet.Running; + using Xunit; + + public class HelloWorldBenchmarks + { + [Benchmark] + public void LoopOneHundredTimes() + { + for (var i = 0; i < 100; i++) + { + _ = i; + } + } + } + + public class HelloWorld + { + [Fact] + public void RunHelloWorldBenchmark() + { + var summary = BenchmarkRunner.Run<HelloWorldBenchmarks>(); + + Assert.NotNull(summary); + } + } +} |
