6

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!

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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 ....

2 Comments

This doesn't work in VS2008 with GetTickCount(). Are you sure it works in VS2010?
I'm affraid I use another library for timestamps (for crossplatform needs) . Therefore, I'm not sure it works specificaly with GetTickCount() but it should. If it doesn't there's a simple workaround : assign GetTickCount() return value to a variable and display that variable : "DWORD x=GetTickCount();" then next line, set a trace point with "timestamp={x}" . I'm sure that works in VS2008 and VS2010. You have an extra, uneeded assignement, but I supposed that this is used only for debugging purposes, not for production code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.