Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import timeit
- # code for test:
- code_to_test = """
- a = range(4000000)
- b = []
- for i in a:
- b.append(i*2)
- """
- #
- try_counts = 10
- elapsed_time = timeit.timeit(code_to_test, number=try_counts) / try_counts
- print(elapsed_time)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement