VC++记录

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);

2. 报错

error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format (...)

解决

csTemp.Format(_T("%f"), totaltime); 

 

posted @ 2018-07-26 10:55  jihite  阅读(359)  评论(0编辑  收藏  举报