views:

170

answers:

3

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.

A: 

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.

rdkleine
-1 because you start off by saying you can't think of anything.
Jack Marchetti
to do -exactly- that, not the same...
rdkleine
+1  A: 

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.

Aaron
+2  A: 

You could use a Tracepoint - which, when hit, will output what you entered to the console window:

alt text

Then you can subtract the latter from the former to get the time between the two.

Philip Wallace
Thanks, that is exactly what I was looking for. If your code takes a couple of seconds to run you could also use {DateTime.Now.Second}
Crackerjack