Skip to content

Instantly share code, notes, and snippets.

@YukiSakamoto
Created December 6, 2012 16:08
Show Gist options
  • Select an option

  • Save YukiSakamoto/4225635 to your computer and use it in GitHub Desktop.

Select an option

Save YukiSakamoto/4225635 to your computer and use it in GitHub Desktop.
Read Time Stamp Counter of IA-64
#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