天天看點

【opencv基礎】測量運作時間的函數getTickCount/getCPUTickCount/getTickFrequency

函數的計算結果類型是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就足夠了。

繼續閱讀