Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # xrange_vs_while.py
- from timeit import timeit
- t = timeit(stmt='while i < 10 ** 7: i += 1',
- setup='i = 0',
- number=1)
- print t
- t = timeit(stmt='for _ in xrange(0, 10 ** 7): pass',
- number=1)
- print t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement