Autor Beitrag
webbi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 142

Win XP Pro SP2, Debian GNU/Linux 2.6
D5 Pro, D7 Pro, BDS2006, Kylix3, MS-VS 2005
BeitragVerfasst: Fr 22.04.05 07:54 
Hallo!

Ich habe eine extrem zeitkritische Anwendung und möchte nun zum debuggen stoppen was wie lange dauert.
In einer Demo habe ich das gefunden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  c, n1, n2 : TLargeInteger;
  i : integer;
begin
   QueryPerformanceFrequency(c);
   QueryPerformanceCounter(n1);
   //Tu was
   QueryPerformanceCounter(n2);
   caption := format('Zeit: %g',[(n2-n1)/ c]);
end;


Kann mir jemand sagen wie genau so ein Ergebnis ist?
Wenn ich mit GetTickCount stoppe bekomme ich eine Differenz von ca. 2ms...
Was ist jetzt genauer?
Hier noch mein stoppen mit GetTickCount:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var

  iStart, iDauer : Cardinal;
begin
   iStart := GetTickCount;
   //Tu was
   iDauer := GetTickCount - iStart;
   caption := IntToStr(iDauer);

end;


Danke schon mal

Webbi
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 22.04.05 08:09 
GetTickCount: 1kHz
QueryPerformanceCounter: 30MHz-3GHz (je nach Unterstützung durch CPU)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.