Pages

Saturday, February 11, 2012

Using StopWatch to Count Execution Time in ASP.NET

Using Stopwatch to Count Execution Time in ASP.NET

 using System.Diagnostics;
 Stopwatch sw = new Stopwatch(); //create object
 sw.Start(); // start the stopwatch
 //do something here
 sw.Stop(); // stop the stopwatch
 Console.WriteLine("Time elapsed : " + sw.ElapsedMilliseconds.ToString());

No comments:

Post a Comment

ShareThis