Reputation: 2154
Does anyone know if you can get the time interval between break points in VS 2008? Plugin?, VS trick?
I DON'T want to add code to my existing source code to figure out how long something takes to run, I would like a quick and dirty way to get this while debugging. For you smart asses out there I know I can always whip out a stopwatch too, but I want something that is somewhat precise as well.
Upvotes: 9
Views: 5864
Reputation: 476
Add two watches:
@clk
@clk = 0
The debugger evaluates them top to bottom, so @clk
will show the time take on that debugger step, and @clk = 0
will reset it back to 0 again for the next step.
Upvotes: 6
Reputation: 8025
You could use a Tracepoint - which, when hit, will output what you entered to the console window:
alt text http://img24.imageshack.us/img24/3866/51292677.png
Then you can subtract the latter from the former to get the time between the two.
Upvotes: 18
Reputation: 9203
There are some useful tricks you can use in this regard with the @clk debug macro. It gives the current timestamp.
At the first breakpoint you add a watch of @clk=0. That resets it to zero. At the second breakpoint look at the value of @clk - it will be the duration since the first breakpoint.
Upvotes: 1
Reputation: 11756
Can't think of anything to do that, but maybe you can use the performance wizard to get some useful (timing) information. On the other hand you can print a message on each hit, you could print the current time.
Upvotes: 0