Gerade nochmal so getestet...
Delphi-Quellcode:
procedure TForm1.Test;
var
I: Integer;
T: cardinal;
begin
// immer schön mit der Maus rühren...
T := GetTickCount;
// Schleife dauert ca. 5000ms.
for I := 0 to 499 do
begin
Sleep(10);
Application.ProcessMessages;
end;
T := GetTickCount - T;
ShowMessage('Dein Delay = ' + IntToStr(T) + 'ms');
T := GetTickCount;
// Schleife dauert 7660ms.
for I := 0 to 499 do
begin
Delay(10);
end;
T := GetTickCount - T;
ShowMessage('Ungeschickter Delay = ' + IntToStr(T) + 'ms');
T := GetTickCount;
// Delay(5000) dauert ca. 5000ms.
Delay(5000);
T := GetTickCount - T;
ShowMessage('Sinnvoller Delay = ' + IntToStr(T) + 'ms');
end;