Cycle Measurement

I have an MS Visual Studio 2005 application . All code is in the C . I want to measure the number of loops executed to perform certain functions. Is there a Win32 API that I can use to calculate the number of cycles?

I used gettimeofday()to get the time in microseconds, but I want to know how many cycles are consumed.

+3
source share
1 answer

Both Intel and AMD offer Windows libraries and tools for accessing performance counters on their processor. They give access not only to the number of loops, but also to cache lines and misses, as well as TLB counts. Intel tools are sold under the name VTune, and AMD calls them CodeAnalyst.

+1
source

Source: https://habr.com/ru/post/1696723/


All Articles