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

后端 未结 4 1073
时光说笑
时光说笑 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:34

    I do count the number o ticks in a second and then compare to the informed clock at /proc/cpuinfo. It only works with dynamic clock disabled. See the source: https://github.com/petersenna/rdtscbench

提交回复
热议问题