Q:

How can I do test for performance in C#

How can I do test for performance in C#?
All that I know now is to use:
Stopwatch sw = new Stopwatch();

sw.Start();
{
     //code to test
}
sw.Stop();

Is there any other way to do this or is the above method wrong ?

A:

Stopwatch is a good, simple way to do performance tests of specific blocks of code. For  large-scale performance testing good tools are available, such as the ones listed in the following SO question:

What Are Some Good .NET Profilers?

Personally, I have good experiences with the free EQATEC Profiler.

