0

I've been developing on Mac before, but recently started using

Visual C++ (VS12). I was wondering if there's any tool in VS that tells you

how much time in seconds a specific function call took?

Ofcourse, I could do this by using a Time/Tick class and print out the time,,

but I was wanted to know if VS has a built-in tool for that..

user2436815
  • 3,455
  • 5
  • 27
  • 40
  • 2
    So you're asking if Visual Studio includes a real-time *profiler*? The answer depends on the depth and thus *cost*) of the visual studio bits you're using. The express version does not (last I checked) include profiling instrumentation. Ultimate certainly does. Consult your docs for your version in-use. – WhozCraig Jun 30 '14 at 16:07

1 Answers1

0

Yes, Visual Studio 2012 has a profiling tool integrated into the IDE. See http://msdn.microsoft.com/en-us/library/z9z62c29(v=vs.110).aspx for documentation, and a basic walkthrough at: http://msdn.microsoft.com/en-us/library/ms182372(v=vs.110).aspx

Also note that if you go the route of adding timer objects to your source code, you should be careful to use the high-resolution clock. See How to use QueryPerformanceCounter?.

(It is a shame that VS2012 doesn't have the high-resolution timer in the <chrono> libraries. See the bug at: https://connect.microsoft.com/VisualStudio/feedback/details/719443/c-chrono-headers-high-resolution-clock-does-not-have-high-resolution.)

Community
  • 1
  • 1
jeffrey_t_b
  • 1,779
  • 12
  • 18