#include int main(void) { long long int tsc; unsigned int tsc1, tsc2; #ifdef __INTEL_COMPILER _asm { rdtsc ; mov tsc1, eax; mov tsc2, edx; } #else asm("rdtsc\n" \ "movl %%eax, %0\n" \ "movl %%edx, %1\n" \ : "=r" (tsc1), "=r" (tsc2) : : "%eax" "%edx"\ ) #endif tsc = tsc2; tsc <<= 32; tsc += tsc1; printf("%u %u\n", tsc2, tsc1); }