home *** CD-ROM | disk | FTP | other *** search
- '
- ' This program prints the prime-numbers from 2 to 1000 to the screen.
- ' The compiled program needs 21 seconds (16 seconds without PRINT-command),
- ' with AmigaBASIC it takes about 226 (212) seconds on my Amiga 500
- '
-
- DEFINT a-z
-
- BeginTime& = TIMER
-
- FOR a = 2 TO 1000
- FOR b = 3 TO a-1
- IF b*INT(a\b) = a THEN NotPrim
- NEXT b
- PRINT a
- NotPrim:
- NEXT a
-
- PRINT "Time needed:";TIMER-BeginTime&
-
- WHILE INKEY$ = "" : WEND
-