var Form1: TForm1; nBeginning: Cardinal = 0; implementation {$R *.dfm} procedure Log(lpMsg: String); begin if nBeginning = 0 then nBeginning:= GetTickCount; Form1.Memo1.Lines.Add(IntToStr(GetTickCount - nBeginning) + ' : ' + lpMsg); end; procedure TForm1.Button1Click(Sender: TObject); begin Log('Avant le sleep'); Sleep(100); Log('Après le sleep'); end;