Created
January 21, 2011 10:44
-
-
Save andreypopp/789522 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
andreypopp> python -m timeit -v "range(40)[:len('string')]" ~ | |
10 loops -> 1.41e-05 secs | |
100 loops -> 0.000143 secs | |
1000 loops -> 0.00119 secs | |
10000 loops -> 0.0117 secs | |
100000 loops -> 0.117 secs | |
1000000 loops -> 1.16 secs | |
raw times: 1.17 1.17 1.18 | |
1000000 loops, best of 3: 1.17 usec per loop | |
andreypopp> python -m timeit -v "range(40)[:6]" ~ | |
10 loops -> 1.22e-05 secs | |
100 loops -> 0.000105 secs | |
1000 loops -> 0.00107 secs | |
10000 loops -> 0.0104 secs | |
100000 loops -> 0.105 secs | |
1000000 loops -> 1.03 secs | |
raw times: 1.04 1.03 1.04 | |
1000000 loops, best of 3: 1.03 usec per loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment