Analyzers
Support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
4682 Discussions

Using Vtune Analyzer to measure timing in C/C++

roopalvp
Beginner
139 Views
Hello everybody,

I am trying to measure how much time my C code is taking with Vtune analyzer. I am using Vtune for the first time so don't know the step to follow to get my desired result meaning measuring timing of my C code. The code has a for loop which runs finite no of times it may run for miliseconds too. Is it possible to measure that small time with vtune?

Please let me know if anybody has doubt in my question.

Thanks,
Roopal Patel
0 Kudos
1 Reply
TimP
Black Belt
139 Views
You can set a lower TBS sample after value, so that VTune time based events occur at a smaller interval, but this will soon make the overhead of VTune significant. In any case, you will get only an approximation of what portion of you sampled interval was spend executing that code.
As you intend to time a specific section of code, you may be able to time millisecond intervals more accurately, by _rdtsc() timer.

Reply