Einzelnen Beitrag anzeigen

Benutzerbild von Flocke
Flocke

Registriert seit: 9. Jun 2005
Ort: Unna
1.172 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#13

Re: Was ist schneller, Funktion oder Prozedure?

  Alt 28. Okt 2005, 14:52
@Angel4585: Besser so, sonst misst du ja fast nur die Laufzeit von QueryPerformanceCounter und nicht von deiner Funktion/Prozedur

Delphi-Quellcode:
var
  lol,lol2: Int64;
  i: Integer;
const anz = 1000000 ;
begin
  QueryPerformanceCounter(lol);
  for i:= 1 to anz do
   begin
   xx(v);
   end;
  QueryPerformanceCounter(lol2);
  Label1.Caption := FloatToStr((lol2-lol)/anz );

  QueryPerformanceCounter(lol);
  for i:= 1 to anz do
   begin
   v:=y;
   end;
  QueryPerformanceCounter(lol2);
  Label2.Caption := FloatToStr((lol2-lol)/anz );
end;
Volker
Besucht meine Garage
Aktuell: RtfLabel 1.3d, PrintToFile 1.4
  Mit Zitat antworten Zitat