C++:运行时间测量

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/baidu_28446365/article/details/79895326
È«¾Ö±äÁ¿µÄÀà
Í·Îļþ
#pragma once
#ifndef __GLOBAL_VARIABLES__
#define __GLOBAL_VARIABLES__
#include <string>
extern long ibegin;
extern double iend;
#endif
class globalVariable
{
public:
	globalVariable();
	~globalVariable();
};

Ô´Îļþ
#include "globalVariable.h"
long ibegin = 0;
double iend = 0.0;
globalVariable::globalVariable()
{
}
globalVariable::~globalVariable()
{
}

µ÷ÓÃ
#if METIME
				ibegin = clock();
#endif
              xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
#if METIME
			  iend += (double)(clock() - ibegin) / CLOCKS_PER_SEC;
			  cout << "iend:" << iend << endl;
			  ofstream infile;
			  infile.open("work.txt");
			  infile << iend << "\n";
			  //printf("\n ME Time: %12.3f sec.\n", iend);
			  infile.close();
#endif

猜你喜欢

转载自blog.csdn.net/baidu_28446365/article/details/79895326