整理了一组精度较高的c++测试间函数,省的以后自己用的时候还得网上整理
#include<Windows.h>
LARGE_INTEGER t1, tt, tc;
QueryPerformanceFrequency(&tc);
QueryPerformanceCounter(&t1);//开始计时
//你的函数
QueryPerformanceCounter(&tt);
float time = (tt.QuadPart - t1.QuadPart)*1.0 / tc.QuadPart;
printf("time=%f", time);//单位为秒