C++ 计算时间间隔,精确到毫秒
#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 获得时间能够精确到毫秒