SYSTEMTIME st;
��CString strDate,strTime;
��GetLocalTime(&st);
��strDate.Format("%4d-%2d-%2d",st.wYear,st.wMonth,st.wDay);
��strTime.Format("%2d:%2d:%2d",st.wHour,st.wMinute,st.wSeco
nd);
使用 GetTickCount//获取程序运行时间
��long t1=GetTickCount();//程序段开始前取得系统运行时间(ms)
��Sleep(500); long t2=GetTickCount();//程序段结束后取得系统
运行时间(ms)
��str.Format("time:%dms",t2-t1);//前后之差即 程序运行时间
��AfxMessageBox(str);//获取系统运行时间
��long t=GetTickCount();
��CString str,str1;
�� str1.Format("系统已运行 %d 时",t/3600000);
�� str=str1; t%=3600000;
��str1.Format("%d 分",t/60000);
��str+=str1; t%=60000;
��str1.Format("%d 秒",t/1000);
��str+=str1; AfxMessageBox(str);