This is an example project demonstrating how to use the BenchmarkDotNet NuGet package to benchmark C# code in a console application.
To run this benchmark, you will need to have .NET 7 or later installed on your machine. You can download the latest version of .NET from the official Microsoft website.
Console
- Navigate to the solution
- Execute the command in release configuration
dotnet run --configuration Release
Visual Studio
- Open the project in Visual studio (ConsoleBenchmarkDotNet.sln)
- Change the configuration from Debug to Release
- Run the project, without debugging.
Below an example result, of the benchmark