高精度计时器

来源:互联网 发布:mac lol美服转日服 编辑:程序博客网 时间:2024/05/16 09:04

GetTickCount()只能到ms,要到ns级的话等用QueryPerformance系列

如:
    LARGE_INTEGER fre,begin,end;
    QueryPerformanceFrequency(&fre);
    QueryPerformanceCounter(&begin);
    QueryPerformanceCounter(&end);
    cout<<"Spend "<<(end.QuadPart-begin.QuadPart)*1000000/fre.QuadPart<<"ns"<<endl; 

原创粉丝点击