经常使用计时操作,做个记录,方便下次直接用。
函数介绍:
function 1: int64 cv::getTickCount ()
The function returns the number of ticks after the certain event (for example, when the machine was turned on). It can be used to initialize RNG or to measure a function execution time by reading the tick count before and after the function call.
function 2: double cv::getTickFrequency()
The function returns the number of ticks per second.
That is, the following code computes the execution time in seconds:
double t = (double)getTickCount();
// do something ...
t = ((double)getTickCount() - t)/getTickFrequency();
cout << "Used time :" << t << "s" << endl;