// 设置计时
clock_t start, finish;
double totaltime;
start = clock();
finish = clock();
/////////////////////
// 需要计算时间的代码//
/////////////////////
// 判定执行时间
totaltime = (double)(finish - start) / CLOCKS_PER_SEC;
CString strOutInfo;
strOutInfo.Format(_T("耗时%0.2f秒\n"), totaltime);
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), strOutInfo, wcslen(strOutInfo), NULL, NULL);