Autor Beitrag
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Mi 25.06.03 20:26 
Ich wollte mal die Zeit stoppen die Mein Programm für eine Routine braucht. In dieser werden aber unter umständen Eingabefelder angezeigt und auf eine eingabe gewartet. Ich habe das bisjetzt so gelöst:

Ganz am anfang:
ausblenden Delphi-Quelltext
1:
2:
3:
  BreakTime := 0;
  // Ein paar zeilen später ...
  Time := GetTickCount;


Dort wo das Eingabefeld angezeigt wird:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
          Temp := GetTickCount;
          if not MyQuery({ dies ist meine Eigene Query, die aber auch per Show Modal läuft wie die normale InputQuery}) then goto LBreakLoop;
          BreakTime := Breaktime + (GetTickCount - Temp);
          Time := Time - BreakTime;


Am Ende:
ausblenden Delphi-Quelltext
1:
2:
    Time := GetTickCount-Time-BreakTime;
    ShowMessage(IntToStr(round(Time/1000))+' secs benötigt.');


Warum funzt das nicht? Das gibt immer so werte wie 611 secs benötigt aus... :(

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Mi 25.06.03 20:47 
Hi,
gettickcount rechnen in millisekunden ... das wird der Fehler sein ...

MfG BungeeBug
mortus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Mi 25.06.03 20:57 
die zeile:
ausblenden Quelltext
1:
Time := Time - BreakTime;					

ist überfluessig oder?

und
ausblenden Quelltext
1:
Time := GetTickCount-Time-BreakTime;					

muesste
ausblenden Quelltext
1:
Time := GetTickCount-Time+BreakTime;					

heissen.
Tweafis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Mi 25.06.03 21:16 
Naja, ich stoppe ja intern die Zeit die der User benötigt um den Dialog auszufüllen. Dass Ziehe ich dann am Ende ab. Werde nochmal testen mit entrfernter Zeile Time := Time - Breaktime

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
mortus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Mi 25.06.03 21:28 
oh stimmt ja. und ich trottel editiers noch um ;)
Tweafis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Mi 25.06.03 21:35 
Du hattest schon recht :D

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.