Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5254 討論

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

roopalvp
初學者
670 檢視
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 積分
1 回應
TimP
榮譽貢獻者 III
670 檢視
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.

回覆