I'm using the following function in my code:
static __inline__ unsigned long long rdtsc(void){
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}
Does this function return number of ticks since last boot? Where can I find documentation about this function?
RDTSC
gets the number of cpu cycles since last reset, see wikipedia.the Intel Instruction Set Manual Vol 2A & B, as a more trusted source:
as a side note: you shouldn't be emitting bytes, rather use the actual
RTDSC
instruction mnemonic, makes it far more readable.