Windows C++纳秒计时?

use*_*112 3 c++ windows performance visual-c++

有没有办法在Windows上用C++来测量以纳秒为单位的时间?

我能找到的只是linux解决方案.

Mar*_*som 5

使用该QueryPerformanceFrequency函数可以查看QueryPerformanceCounter运行的速度.我认为它可能在纳秒范围内.

  • 非常旧的API调用,不会调整任务切换. (2认同)