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?