Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Frage zum Zeitstempel mit now (https://www.delphipraxis.net/176747-frage-zum-zeitstempel-mit-now.html)

jupiter4065139 24. Sep 2013 16:59

AW: Frage zum Zeitstempel mit now
 
Zitat:

Zitat von MyRealName (Beitrag 1229773)
Windows hat ein scheduling system, da kannst dich um bestimte Uhrzeiten aufrufen lassen...

? Was willst Du damit jetzt sagen?

hathor 24. Sep 2013 18:25

AW: Frage zum Zeitstempel mit now
 
SetWaitableTimer
Findest Du hier im Forum:
http://www.delphipraxis.net/968614-post10.html

hathor 28. Sep 2013 12:57

AW: Frage zum Zeitstempel mit now
 
@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;


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:40 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz