Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import timeit
- def func(iterable):
- for i in iterable:
- i = i*2
- n = 100
- # timeit возвращает время выполнения функции f
- print(timeit.timeit(lambda: func([ i for i in range(n) ])))
- print(timeit.timeit(lambda: func(i for i in range(n))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement