@jupiter4065139
Dein Beispiel tut bei mir nichts.
Ich habe hier was Besseres mit
SetWaitableTimer:
Delphi-Quellcode:
procedure Wait(lNumberOfSeconds : Longint);
var
lBusy, hTimer : Cardinal;
liDueTime : LARGE_INTEGER;
begin
hTimer := CreateWaitableTimer(nil, True, 'WaitableTimer');
if hTimer = 0 then Exit;
liDueTime.QuadPart := -10000000 * lNumberOfSeconds;
SetWaitableTimer(hTimer, TLargeInteger(liDueTime), 0, nil, nil, False);
repeat
lBusy := MsgWaitForMultipleObjects(1, hTimer, False, INFINITE, QS_ALLINPUT);
Application.ProcessMessages;
Until lBusy = WAIT_OBJECT_0;
// Close the handles when you are done with them.
CloseHandle(hTimer);
End;
procedure TForm1.Button1Click(Sender: TObject);
var i : Integer;
begin
Memo1.lines.add(' START: '+TimeToStr(now));
for I := 0 to 4 do // 5 Minuten
begin
wait(60); //60 Sec
Memo1.lines.add(IntToStr(i)+' - '+TimeToStr(now));
end;
Memo1.lines.add(' READY: '+TimeToStr(now));
end;