Created
July 5, 2014 17:38
-
-
Save ntddk/abff4257ffd35bdad1d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
uint64_t rdtsc(void) | |
{ | |
uint64_t ret; | |
__asm__ volatile("rdtsc" : "=A"(ret)); | |
return ret; | |
} | |
int main(void) | |
{ | |
printf("clock conut = 0x%llx\n", rdtsc()); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment