opencv 计算算法运行时间

#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;

int main(int argc, char** argv)
{
	int a[10] = { 0 };
	for (size_t i = 0; i < 10; i++)
	{
		a[i] = 10 * i;
	}

	double time0 = static_cast<double>(getTickCount());

	for each (int var in a)
	{
		printf("%d\t", var);
	}
	cout << endl;
	for (auto i:a)
	{
		printf("%d\t", i);
	}
	
	time0 = ((double)getTickCount() - time0) / getTickFrequency();
	cout << "use time is " << time0 << endl;
	return 0;
}


猜你喜欢

转载自blog.csdn.net/moonlightpeng/article/details/80961915