1 2 3 4 5 6 7 8 9
|
procedure TForm1.TimerTimer(Sender: TObject);
var
Hour, Min, Sec, MSec: Word;
begin
tps_now := now; // on récupère la date et l'heure actuel
DecodeTime((tps_now - tps_start), Hour, Min, Sec, MSec); // on calcule le temps écoulé depuis la référence (tps_Start - tps_now) et on extrait les infos (H, M, S, Ms ) F1 sur DecodeTime pour plus d'infos
lblTime.Caption:=intToStr(Hour)+'Hr '+intToStr(Min)+'Min '+intToStr(Sec)+'Sec '+intToStr(MSec)+'Ms'; // on construit notre affichage et on l'affiche
end; |
Partager