'=========================================================================== ' Subject: SIEVE OF ERATOSTHENES BENCHMARK Date: 12-23-98 (18:30) ' Author: The ABC Programmer Code: BEC ' Origin: voxel@edmc.net Packet: BASEC.ABC '=========================================================================== rem ******************************** rem *** BASEC version of Classic *** rem *** Sieve of Eratosthenes *** rem *** Benchmark *** rem ******************************** rem rem This will prove how slow BASEC really is :) rem Trust me, 25 iterations is too long, you'll want to press CTRL+BREAK rem From this, I gather BASEC is over 10 times slower than PB and QB. rem However, a fair test would be against other p-code compilers or interpreters. rem For BASEC v0.15 [DOS/UNIX] by William Yu DIM Flags(8190) AS INTEGER PRINT "Sieve - 25 iterations" X& = TIMER FOR Iter = 1 TO 25 Count = 0 FOR I = 0 TO 8190 Flags(I) = 1 NEXT I FOR I = 0 TO 8190 IF Flags(I) = 1 THEN Prime = I + I Prime = Prime + 3 K = I + Prime WHILE K <= 8190 Flags(K) = 0 K = K + Prime WEND Count = Count + 1 END IF NEXT I ?"Iteration ";Iter;": ";Count;" took "; (TIMER - X&); " seconds." X& = TIMER NEXT Iter END