1. 记录时间
#include <atlstr.h>
#include <time.h>
clock_t clockBegin, clockEnd; clockBegin = clock(); // do sth. clockEnd = clock(); double totaltime = (double)(clockEnd-clockBegin)/CLOCKS_PER_SEC; //输出时间是s CString csTemp; csTemp.Format("%f", totaltime); OutputDebugString(csTemp);