函数的计算结果类型是double,单位是秒。
要使用更精确的计时,就需要使用getCPUTickCount(),不过现代计算机CPU的频率会随着负载而变化所以没大有必要使用该函数,可以参看函数的介绍【Also, since a modern CPU varies the CPU frequency depending on the load, the number of CPU clocks spent in some code cannot be directly converted to time units. Therefore,getTickCount is generally a preferable solution for measuring execution time.】也就是使用getTickCount就足够了。
参考
完
原文地址:https://www.cnblogs.com/happyamyhope/p/9828775.html
时间: 2024-10-08 14:58:43