views:

36

answers:

2

I'd like to measure the performance of some code blocks in my c# winforms application. In particular I want to measure performance regression/improvement after some restructuring of the code.

So long I've seen the System.Diagnostics.Stopwatch. However, I want to avoid writing measuring code into my classes, I would rather prefer to separate measuring from actual code.

As for debugging, you can set breakpoints on several code lines and "jump" from one to the next by "Continue Execution", I imagine something similar for measuring: Mark to lines of code and make Visual Studio display the time elapsing from one to the next.

Is there any free feature/add-in in that direction?

A: 

Google for a .NET profiler. There are many. Some integrate into VS. Some are free, most are not.

leppie
Hmm... "Google" - I think I might have heard this term somewhere in past, sounds promising... ;-) - Seriously: Yes, there are many, and yes, only a small subset integrate into VS, and only a subset are free. So this hint doesn't really help me.
chiccodoro
+1  A: 

Try NProf it's not an addin but it's free. Also SharpDevelop has an in built profiler.

SDX2000
PS: I know an addin will go a long way in streamlining the development process but writing VS addins is tedious and addins often break between VS versions so finding good addins is difficult.
SDX2000
Thanks SDX2000. You maybe right with the VS addin issues. Still I would be interested if there are any.
chiccodoro