C++中测试一段程序用的时间

tech2025-09-05  19

CString str_time; long t1 = GetTickCount();///程序段开始前取得系统运行时间(ms) //程序段 long t2 = GetTickCount();//程序段结束后取得系统运行时间(ms) str_time.Format(“time:%dms”, t2 - t1);//前后之差即程序运行时间 AfxMessageBox(str_time);

最新回复(0)