C++ 测量程序执行时间的办法

#include  <time.h> 

clock_t start = clock();  //时间起始 
/*待测试代码*/         
clock_t end   = clock(); //时间测试结束

cout<<end - start<<endl; //计算打印出运行时间,单位ms

 

posted @ 2019-07-29 10:47  白菜没我白  阅读(3099)  评论(0编辑  收藏  举报