Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4998 Discussions

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

roopalvp
Beginner
371 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
Honored Contributor III
371 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.

0 Kudos
Reply