#include <time.h>
clock_t start,ends;
start=clock();
system("pause");
ends=clock();
cout<<ends-start<<endl;
time_t 获得时间只能精确到秒,clock_t 获得时间能够精确到毫秒
#include <time.h>
clock_t start,ends;
start=clock();
system("pause");
ends=clock();
cout<<ends-start<<endl;
time_t 获得时间只能精确到秒,clock_t 获得时间能够精确到毫秒
转载于:https://www.cnblogs.com/lucyjiayou/archive/2010/12/16/1908290.html