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.
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?
Edit: is there anything beyond System.Diagnostics.Stopwatch
?
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With