unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
b1,b2,b3,b4,b5,b6,b7,b8,b9,
b10,b11,b12,b13,b14,b15,b16,b17,b18,b19: integer;
t1, t2, t3, t4, t5, t6:
string;
implementation
{$R *.dfm}
procedure lokal(i:integer);
var i1,i2,i3,i4,i5,i6,i7,i8,i9,
i10,i11,i12,i13,i14,i15,i16,i17,i18,i19: integer;
s1, s2, s3, s4, s5, s6:
string;
begin
s1:='
test';
s2:='
test';
s3:='
test';
s4:='
test';
s5:='
test';
s6:='
test';
i1:=2*(i);
i2:=2*(i1);
i3:=2*(i2);
i4:=2*(i3);
i5:=2*(i4);
i6:=2*(i5);
i7:=2*(i6);
i8:=2*(i7);
i9:=2*(i8);
i10:=2*(i9);
i11:=2*(i10);
i12:=2*(i11);
i13:=2*(i12);
i14:=2*(i13);
i15:=2*(i14);
i16:=2*(i15);
i17:=2*(i16);
i18:=2*(i17);
i19:=2*(i18);
end;
procedure global(b:integer);
begin
t1:='
test';
t2:='
test';
t3:='
test';
t4:='
test';
t5:='
test';
t6:='
test';
b1:=2*(b);
b2:=2*(b1);
b3:=2*(b2);
b4:=2*(b3);
b5:=2*(b4);
b6:=2*(b5);
b7:=2*(b6);
b8:=2*(b7);
b9:=2*(b8);
b10:=2*(b9);
b11:=2*(b10);
b12:=2*(b11);
b13:=2*(b12);
b14:=2*(b13);
b15:=2*(b14);
b16:=2*(b15);
b17:=2*(b16);
b18:=2*(b17);
b19:=2*(b18);
end;
procedure TForm1.Button1Click(Sender: TObject);
var i,b, start, max:integer;
stop, stop2:
string;
begin
max:=1000000;
start:= GetTickCount;
for i:= 1
to max
do
lokal(i);
stop:=IntToStr(GetTickCount-Start);
start:= GetTickCount;
for b:= 1
to max
do
global(b);
stop2:=IntToStr(GetTickCount-Start);
memo1.Lines.Add('
lokal '+stop+'
global '+stop2);
end;
end.