PlayBASIC Code:
   STartTime=Timer()
      Count=SieveOfEratosthenes(250000)
   print Timer()-StartTIME
   print Count
   print "done"
   
   sync
   waitkey
   



Function SieveOfEratosthenes(Limit)
    Dim Primes(Limit)
    ClearArray Primes(),True
    
    Primes(0) = False
    Primes(1) = False

    For p = 2 To Sqrt(Limit)
        If Primes(p)
            For i = p * p To Limit Step p
                Primes(i) = False
            Next
        EndIf
    Next

    For i = 2 To Limit
        COUNT+=Primes(i)
    Next
EndFunction Count
COMMANDS USED: TIMER | PRINT | SYNC | WAITKEY | DIM | CLEARARRAY | SQRT |