eclipse平台下,C++做的工程里,测试某功能模块的时间应该用哪个函数?


在eclipse平台下,用C++开发的项目,想测试一下某功能模块的耗时,请问应该用哪个函数?

eclipse C++

AZU喵.啾 12 years, 9 months ago
   
  #include "time.h"
  

clock_t beg, end;
beg = clock();
int cnt = 0;
for(; cnt < 1000000000; ) ++cnt;
end = clock();
printf("%f",(double)(end - beg));





2657.000000

反叛的舒露露 answered 12 years, 9 months ago

Your Answer