Search

Using "rdtsc" with gcc

Using the "rdtsc"

rdtsc is a time stamp counter that returns  the number of clock ticks from the time the system was last reset.
The rdtsc instruction returns the time stamp counter in EDX:EAX.

This instruction is useful when you want to measure the performance of a certain code or application in clock ticks, or compare the performance of two programs, which are too small to be counted in seconds.

Here is a sample C code that shows how you can make use of this instruction.



No comments:

Post a Comment