double time0 = static_cast<double>(getTickCount());
//要计算的程序运行时间代码
...
time0 =((double)getTickCount() - time0)/getTickFrequency();
cout<<"yunxing time :"<<time0<<endl;
C/C++ 计算程序片段运行时间
最新推荐文章于 2024-04-10 10:29:46 发布
double time0 = static_cast<double>(getTickCount());
//要计算的程序运行时间代码
...
time0 =((double)getTickCount() - time0)/getTickFrequency();
cout<<"yunxing time :"<<time0<<endl;