Created
December 11, 2012 21:36
-
-
Save monolithed/4262349 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### range | |
python -m timeit -c 'for x in range(100): pass' | |
#100000 loops, best of 3: 3.17 usec per loop | |
python -m timeit -c 'for x in range(10000): pass' | |
1000 loops, best of 3: 314 usec per loop | |
### xrange | |
python -m timeit -c 'for x in xrange(100): pass' | |
#100000 loops, best of 3: 4.62 usec per loop | |
1000 loops, best of 3: 252 usec per loop | |
python -m timeit -c 'for x in xrange(10000): pass' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment