70,037
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
__inline__ unsigned long long int rdtsc()
{
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}
int main(void)
{
unsigned long long int start, end;
start = rdtsc();
printf("hello, world!\n");
end = rdtsc();
printf("%llu\n", end - start);
return 0;
}