C++测试程序运行时间

#include "time.h"

clock_t start, finish;
double  duration;

start = clock();

//**************//

finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
cout<<"cost :"<<duration<<"seconds"<<endl;
system("pause");

你可能感兴趣的:(C++,测试)