Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trace/output timestamp in Visual C++ 2010 while debugging

guys, VC2010 provides debugging tool "trace" which enable to output not only variable values into output window, but also some built in arguments like TID TNAME, PID, etc.

I want to make trace to output time stamp also, is this possible int VS2010?

Thanks!

like image 807
giggle Avatar asked Apr 19 '11 08:04

giggle


2 Answers

You can use the predefined variable $TICK, info @ MSDN

like image 116
QuantumBlack Avatar answered Oct 20 '22 14:10

QuantumBlack


You can output the result of an expression by using curly brackets.

If you have

int x;
x=10;
...

and you setup a trace point after x=10 witht he expression x={x}, it will output x=10 to your output window.

Just put an expression which gives you a timestamp inside the curly brackets, like timestamp={time(0)} (depending of course which API you use to get the time ....

like image 22
Dinaiz Avatar answered Oct 20 '22 15:10

Dinaiz