<p>I need to do some performance benchmarks on .NET programs (C#) in Windows, but I haven't done benchmarking much in the Windows world.  I've looked into using the Windows 2000/XP Performance monitor with custom counters for this, but I don't think this is quite what I want.</p>

<p>Are there any good system facilities for this in Windows XP, or do I need to just use System.Diagnostics.Stopwatch [edit] and write text logs for manual interpretation, or is there something else?</p>

<p>Edit: is there anything beyond <code>System.Diagnostics.Stopwatch</code>?</p>

```
```
using System.Diagnostics;
....

Stopwatch sw = new Stopwatch();

sw.Start();

// Code you want to time...

// Note: for averaged accuracy (without other OS effects), 
//       run timed code multiple times in a loop 
//       and then divide by the number of runs.

sw.Stop();

Console.WriteLine("Took " + sw.ElapsedTicks + " Ticks");
```
```