{ 1 h=1*60 m=1*60*60 s=1*60*60*1000 hs=3600000hs} function StartCount():string; {$j+} const h:Integer=0; m:Integer=0; s:integer=0; {$j-} begin inc(s); if s>=60 then begin Inc(m); s:=0; end; if m>=60 then begin Inc(h); m:=0; end; Result:=Format('%.2d:%.2d:%.2d',[h,m,s]); end;
procedure TForm1.Timer1Timer(Sender: TObject); begin label1.Caption:= StartCount(); end;
///倒计时
function dec1():string; {$j+} const i:Integer=60*5; {$j-} begin Dec(i); Result:=Format('剩余时间:%d',[i]); end;
procedure TForm1.Timer1Timer(Sender: TObject);{$j+} begin label1.Caption:=dec1; end;