Autor Beitrag
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Fr 18.07.03 17:48 
Hi

Wie bring ich in einer Prozedur eine Verzögerung ohne sleep und ohne einen Timer rein...ich meine Damit, das trotzdem weiter gearbeitet werden soll.
Ich meine irgendwo mal so einen Code gelesen zu haben... :?
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Fr 18.07.03 18:55 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure SleepEx(Msec:Cardinal);
var OT:Cardinal;
begin
 OT:=GetTickCount;
 while OT+MSec>GetTickCount do begin
  Application.ProcessMessages;
  Sleep(1); // nötig damit CPU-Auslastung nicht auf 100 % steigt
 end;
end;
Nicht getestet, sollte aber funktionieren.
maxk[/delphi]

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.