Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from numba import jit
- import time
- import math
- @jit(nopython=True)
- def bench(n):
- s = 0
- for i in range(n):
- s+=(2*3)%7 #math.sin(i)
- return s
- def main(n):
- for i in range(n):
- t = time.time()
- s = bench(10000000)
- d = time.time() - t
- if i == 0:
- f = input('ddd:')
- print d
- print s
- if __name__ == '__main__':
- main(3)
- """
- 1.24100017548
- 60000000
- 0.0
- 60000000
- 0.0
- 60000000
- without jit:
- 1.93700003624
- 60000000
- 1.80199980736
- 60000000
- 1.83800005913
- 60000000
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement