I'm looking for a tool to tell me how long my code takes to run. Something that would be the equivalent of recording the DateTime.Now
before and after each line of code in my program, then displaying the difference between the two times for each line (after my program finishes running).
For instance, if I have a program that calls four methods in its main, I want to know (after running this tool) how long each of those methods takes to run, and then if I stepped into each method, I'd want to know how long each line in there takes to run, and so on.
Do these tools exists? Of course I'd prefer a free one, but if all that exist are professional tools then please mention those as well.
edit: it appears these tools are called Profiling tools. Thanks, this will definitely help me in my search. Unfortunately, I'm using Visual Studio 2010 Professional, so I believe the Microsoft profiling tool is out of my grasp. Any good third-party profiling tools?