19,468
社区成员
发帖
与我相关
我的任务
分享
LARGE_INTEGER tBefore, tAfter, i64PerfFrequency;
// Figure out how often the performance counter increments
QueryPerformanceFrequency( &i64PerfFrequency );
// Get performance counter before the ANSI API loop
QueryPerformanceCounter( &tBefore );
//run your code here
……
// Get performance counter after the ANSI API loop
QueryPerformanceCounter( &tAfter );
double tSecond = (double)(tAfter.QuadPart - tBefore.QuadPart)/(double)i64PerfFrequency.QuadPart;