๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.pascal
Article #93042

Re: DynamicArray kontra StaticArray

#93042
From: Wiktor S.
Date: Thu, 01 Jul 2010 21:40
43 lines
1823 bytes
No i mamy, bardziej miarodajny test, z zapisem i odczytem, i nie tylko 
[zera]

//---------
{$mode objfpc}

uses sysutils;

var OpenArray:Array of Longint;
    DefArray:Array[0..10] of Longint;

    L1,L2:integer;
    StartTime,EndTime:TDateTime;
    loop:integer;

begin
    L2:=15;
    SetLength(OpenArray,10);
    StartTime:=Now;
    OpenArray[4]:=1;
    For L1:=1 to L2 do
      For Loop:=1 to 1000000000 do OpenArray[7]:=OpenArray[7]+OpenArray[4];
    EndTime:=Now;
    writeln(' Tablica OpenArray '+ TimeToStr(EndTime-StartTime));

    StartTime:=Now;
    DefArray[4]:=1;
    For L1:=1 to L2 do
      For Loop:=1 to 1000000000 do DefArray[7]:=DefArray[7]+DefArray[4];
    EndTime:=Now;
    writeln(' Tablica DefArray '+ TimeToStr(EndTime-StartTime));
end.
//---------


i dostajฤ™

 Tablica OpenArray 00.00.46
 Tablica DefArray 00.00.39


-- 
Azarien
Technical Details
Message-ID: <i0j212$c42$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
References: <60b5.000013db.4c2c66b2@newsgate.onet.pl> <i0j1hg$ar7$1@news.onet.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
From: "Wiktor S." <wswiktor&poczta,fm@no.spam>
Newsgroups: pl.comp.lang.pascal
Subject: Re: DynamicArray kontra StaticArray
Date: Thu, 1 Jul 2010 23:40:50 +0200
Organization: http://onet.pl
Lines: 44
Message-ID: <i0j212$c42$1@news.onet.pl>
References: <60b5.000013db.4c2c66b2@newsgate.onet.pl> <i0j1hg$ar7$1@news.onet.pl>
NNTP-Posting-Host: 193.239.126.100
Mime-Version: 1.0
X-Trace: news.onet.pl 1278020450 12418 193.239.126.100 (1 Jul 2010 21:40:50 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Thu, 1 Jul 2010 21:40:50 +0000 (UTC)
In-Reply-To: <i0j1hg$ar7$1@news.onet.pl>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6002.18197
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18197
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit