Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import times
- template `print`(a: any) = echo a
- var a = @[1,2,3]
- for i in a:
- echo i
- proc is_prime(n: int): bool =
- if n<2: return false
- var d = 2
- while n mod d != 0:
- d+=1
- result = d == n
- var primes = newSeq[int](0)
- print 97999997-97999797
- let t0 = epochTime()
- for i in 97999797..97999997:
- if is_prime(i):
- primes.add(i)
- echo epochTime() - t0
- echo primes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement