The Stopwatch class is a quick and easy way to get executing timings from your code.
The example code below shows how to get the execution time from a section of code:
using System.Diagnostics;
Stopwatch timer = new Stopwatch();
timer.Start();
// Enter the code here that you want to time
timer.Stop();
long elapsedTime = timer.ElapsedMilliseconds;
Stopwatch timer = new Stopwatch();
timer.Start();
// Enter the code here that you want to time
timer.Stop();
long elapsedTime = timer.ElapsedMilliseconds;
Submitted by Jamie McQuay on Fri, 04/10/2009 - 20:30
