home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
bix
/
sbench.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-08-04
|
819b
|
36 lines
{TITLE: Pascal Sieve BenchMark}
(*$i-*)
program sieve;
const size=8190;
var flags:array[0..size] of boolean;
i,prime,k,count,iter:integer;
begin
write('Press return to start: '); readln;
writeln('Size of flags: ',sizeof(flags));
writeln('10 iterations');
for iter:=1 to 10 do
begin
count:=0;
for i:=0 to size do flags[i]:=TRUE;
for i:=0 to size do
if flags[i] then
begin
prime := i+i+3;
k := i+prime;
while k<=size do
begin
flags[k] := false;
k := k+prime;
end;
count := count+1;
end;
end;
writeln(count, ' primes.');
writeln('Finished.');
end.