You are on page 1of 1

=======================================================================================

Measuring Execution Time


=======================================================================================
Stopwatch is designed for this purpose and is one of the best way to measure time execution in .NET.

var watch = System.Diagnostics.Stopwatch.StartNew();


// the code that you want to measure comes here
watch.Stop();
var elapsedMs = watch.ElapsedMilliseconds;

You might also like