API文档:https://docs.opencv.org/2.4/modules/highgui/doc/user_interface.html#
-
cv.getTickCount() / cv.getTickFrequency()
返回tick的值,可用于记录某个步骤或方法花费了多长时间(计算出来的单位为'秒')。
import cv2 as cv
t = cv.getTickCount()
'''
Invoke some functions at here
'''
t = (cv.getTickCount() - t) / cv.getTickFrequency() # Time unit is 'second'
print("Cost %f s" % (t))