CString str_time;
long t1 = GetTickCount();///程序段开始前取得系统运行时间(ms)
//程序段
long t2 = GetTickCount();//程序段结束后取得系统运行时间(ms)
str_time.Format(“time:%dms”, t2 - t1);//前后之差即程序运行时间
AfxMessageBox(str_time);
C++中测试一段程序用的时间
最新推荐文章于 2023-12-15 14:05:02 发布
CString str_time;
long t1 = GetTickCount();///程序段开始前取得系统运行时间(ms)
//程序段
long t2 = GetTickCount();//程序段结束后取得系统运行时间(ms)
str_time.Format(“time:%dms”, t2 - t1);//前后之差即程序运行时间
AfxMessageBox(str_time);