1.
exit: 退出函数体
abort: 遇到异常,安静处理,就是不显示不提示
break: 退出当前循环体,包括for ,while, repeat等循环体
continue: 结束循环内的本次处理,继续从循环体的开始位置继续执行
2. 获得电脑运行时间
function TickCountToString(dwTickCount: DWORD): string;
var
nVal: DWORD;
begin
Result := '';
//day
nVal := dwTickCount div (24 * 60 * 60 * 1000);
Result := Result + IntToStr (nVal ) + '-';
if nVal > 0 then
Dec( dwTickCount, nVal * 24 * 60 * 60 * 1000);
//hour
nVal := dwTickCount div (60 * 60 * 1000);
Result := Result + IntToStr (nVal );
if nVal > 0 then
Dec( dwTickCount, nVal * 60 * 60 * 1000);
//min
nVal := dwTickCount div (60 * 1000);
Result := Result + ':' + IntToStr (nVal );
if nVal > 0 then
Dec( dwTickCount, nVal * 60 * 1000);
//sec
nVal := dwTickCount div (1000);
Result := Result + ':' + IntToStr (nVal );
end;
|
请发表评论