标签:
1.最精确
QueryPerformanceFrequency(&nFreq);
cout <<nFreq.QuadPart<<endl;//获得计数频率
QueryPerformanceCounter(&s);//获取当前计数次数
QueryPerformanceCounter(&e);//获取当前计数次数
float tt = e.QuadPart - s.QuadPart;
<windows.h>的DWORD GetTickCount(void);返回(retrieve)从操作系统启动所经过(elapsed)的毫秒数
int TimeStart=GetTickCount();
int TimeEnd=GetTickCount();
3.
time_t stime , etime ;//time_t = long
time( &stime );
time( &etime );
4.
double begin=(double)clock();
double end=(double)clock();
标签:
原文地址:http://www.cnblogs.com/huangshiyu13/p/5440093.html