2个回答
展开全部
系统计时
时间要求比较精确时:DWORD t1 = GetTickCount();
DWORD t2 = GetTickCount();
运行时间:T= t2 - t1;
时间较长时:
Word Hour,Min,Sec,MSec;
StartDateTime = Now(); //开始计时
double Temp = Now() - StartDateTime;
DecodeTime((Temp - int(Temp)),Hour,Min,Sec,MSec);
LblRunTime->Caption = "系统已经运行: "+String(int(Temp)*24+Hour)+"小时"+String(Min)+"分 "+String(Sec)+"秒";
时间要求比较精确时:DWORD t1 = GetTickCount();
DWORD t2 = GetTickCount();
运行时间:T= t2 - t1;
时间较长时:
Word Hour,Min,Sec,MSec;
StartDateTime = Now(); //开始计时
double Temp = Now() - StartDateTime;
DecodeTime((Temp - int(Temp)),Hour,Min,Sec,MSec);
LblRunTime->Caption = "系统已经运行: "+String(int(Temp)*24+Hour)+"小时"+String(Min)+"分 "+String(Sec)+"秒";
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询