LONGLONG t1, t2, persecond;
QueryPerformanceFrequency((LARGE_INTEGER *) &persecond); //询问系统一秒钟的频率
QueryPerformanceCounter((LARGE_INTEGER *) &t1);
......
QueryPerformanceCounter((LARGE_INTEGER *) &t2);
double time = (double)(t2 - t1)/persecond;
CString str;
str.Format(_T("系统已运行 %.12f 秒"),time);
AfxMessageBox(str);