How to detect if RDTSC returns a constant rate counter value?

后端 未结 4 1100
时光说笑
时光说笑 2021-01-19 15:17

It seems most newer CPUs from both AMD and Intel implement rdtsc as a constant rate counter, avoiding the issues caused by frequency changing as a result of things like Turb

4条回答
  •  自闭症患者
    2021-01-19 15:41

    just use CPUID to detect the generation of the CPU, see if its using constant counters. I'd however, suggest using a profiling API instead though, something like AMD's codeanalyst sdk would do well

提交回复
热议问题