locked
is there an instructional timer in VS 2010 debugger? I think there used to be a '@clock' symbol that could be use to time instructions. RRS feed

  • Question

  • A few version of Visual Studio ago, as you were debugging, you could enter a symbol, I think something like @clock, in the watch window, then on the next line you would clear out the clock with a @clock = 0 symbol.
    Then as you stepped over the code, it would show how much time elapsed for each step.
    It came in real handy to make code run faster.
    Is that option gone in version 2010?
    is there something like it?
    C++ C# application programmer
    Friday, March 25, 2011 8:32 PM

Answers

  • A few version of Visual Studio ago, as you were debugging, you could enter a symbol, I think something like @clock, in the watch window, then on the next line you would clear out the clock with a @clock = 0 symbol.
    Then as you stepped over the code, it would show how much time elapsed for each step.
    It came in real handy to make code run faster.
    Is that option gone in version 2010?
    is there something like it?

    Try $clk

    http://stackoverflow.com/questions/159888/how-to-execute-getlasterror-while-debugging-in-visual-studio

    Dave

    • Marked as answer by eryang Monday, April 11, 2011 6:25 AM
    Friday, March 25, 2011 10:12 PM

All replies

  • A few version of Visual Studio ago, as you were debugging, you could enter a symbol, I think something like @clock, in the watch window, then on the next line you would clear out the clock with a @clock = 0 symbol.
    Then as you stepped over the code, it would show how much time elapsed for each step.
    It came in real handy to make code run faster.
    Is that option gone in version 2010?
    is there something like it?

    Try $clk

    http://stackoverflow.com/questions/159888/how-to-execute-getlasterror-while-debugging-in-visual-studio

    Dave

    • Marked as answer by eryang Monday, April 11, 2011 6:25 AM
    Friday, March 25, 2011 10:12 PM
  • thanks Dave, but that doesn't work either. it doesn't like @clk or $clk  

    Is there anything else that i can try?


    C++ C# application programmer
    Sunday, May 1, 2011 5:02 PM
  • Just tested it, functions for me, when I do:
    checking Print a message in bp-window "When Hit" Column
    Inserting at first bp:  Time: {$CLK=0}
    Inserting at second bp: Time: {$CLK,d} (the d is for formatting I assume)
    VS2010 SP1 C++ 32Bit

    Sunday, May 1, 2011 7:39 PM