Skip to main content

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision.

Stopwatch sw = new Stopwatch(); sw.Start(); // Do Work sw.Stop(); Console.WriteLine("Elapsed time: {0}", sw.Elapsed.TotalMilliseconds); 

Alternatively, if you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

Here a screenshot of it showing line-by-line profiling:

alt text http://www.red-gate.com/products/ants_profiler/images/performance/performance_profiling_results_sourcecode.gif

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision.

Stopwatch sw = new Stopwatch(); sw.Start(); // Do Work sw.Stop(); Console.WriteLine("Elapsed time: {0}", sw.Elapsed.TotalMilliseconds); 

Alternatively, if you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

Here a screenshot of it showing line-by-line profiling:

alt text http://www.red-gate.com/products/ants_profiler/images/performance/performance_profiling_results_sourcecode.gif

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision.

Stopwatch sw = new Stopwatch(); sw.Start(); // Do Work sw.Stop(); Console.WriteLine("Elapsed time: {0}", sw.Elapsed.TotalMilliseconds); 

Alternatively, if you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

added 172 characters in body
Source Link
mmcdole
  • 93.2k
  • 61
  • 189
  • 224

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision. If

Stopwatch sw = new Stopwatch(); sw.Start(); // Do Work sw.Stop(); Console.WriteLine("Elapsed time: {0}", sw.Elapsed.TotalMilliseconds); 

Alternatively, if you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

Here a screenshot of it showing line-by-line profiling:

alt text http://www.red-gate.com/products/ants_profiler/images/performance/performance_profiling_results_sourcecode.gif

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision. If you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

Here a screenshot of it showing line-by-line profiling:

alt text http://www.red-gate.com/products/ants_profiler/images/performance/performance_profiling_results_sourcecode.gif

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision.

Stopwatch sw = new Stopwatch(); sw.Start(); // Do Work sw.Stop(); Console.WriteLine("Elapsed time: {0}", sw.Elapsed.TotalMilliseconds); 

Alternatively, if you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

Here a screenshot of it showing line-by-line profiling:

alt text http://www.red-gate.com/products/ants_profiler/images/performance/performance_profiling_results_sourcecode.gif

Source Link
mmcdole
  • 93.2k
  • 61
  • 189
  • 224

If you want something quick and dirty I would suggest using Stopwatch instead for a greater degree of precision. If you need something a little more sophisticated you should probably consider using a 3rd party profiler such as ANTS.

Here a screenshot of it showing line-by-line profiling:

alt text http://www.red-gate.com/products/ants_profiler/images/performance/performance_profiling_results_sourcecode.gif