Visual Studio 2008 - Get time interval between break points?
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 de开发者_如何转开发bugging. 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.
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.
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.
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.
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.
精彩评论