Some CPUs don't give good results.
#include <intrin.h>
int __cdecl printf(const char * restrict format, ...);
int __cdecl main(int argc, char **argv)
{
int regs[5];
int cnt = 0;
unsigned long long tt;
for (int i=0; i <20; i++) {
tt =_rdtsc();
_cpuid((int *)®s, 0);
for (int j=0; j <1000; j++) cnt++;
tt =_rdtsc() - tt;
printf("ticks: %llu %d\n", tt, cnt);
}
return 0;
}