Benchmarking Your .NET Core Code With BenchmarkDotNet – Dot Net Core Tutorials
While wrapping your code in a timer and running it a few hundred times is a good start, it’s not exactly reliable. There are far too many pitfalls that you can get trapped in that completely skew your results. Luckily there is always a Nuget package to cover you! That package in this case is BenchmarkDotNet.