Skip to content

Instantly share code, notes, and snippets.

@dcramer dcramer/gist:6682862
Created Sep 24, 2013

Embed
What would you like to do?
TIL use 'while 1' instead of 'while True'
dcramer:buildbox in ~/Development/buildbox on git:master
$ python -m timeit '(True and "pass")'
10000000 loops, best of 3: 0.0512 usec per loop
dcramer:buildbox in ~/Development/buildbox on git:master
$ python -m timeit '(True and "pass")'
10000000 loops, best of 3: 0.049 usec per loop
dcramer:buildbox in ~/Development/buildbox on git:master
$ python -m timeit '(True and "pass")'
10000000 loops, best of 3: 0.0501 usec per loop
dcramer:buildbox in ~/Development/buildbox on git:master
$ python -m timeit '(1 and "pass")'
10000000 loops, best of 3: 0.0444 usec per loop
dcramer:buildbox in ~/Development/buildbox on git:master
$ python -m timeit '(1 and "pass")'
10000000 loops, best of 3: 0.042 usec per loop
dcramer:buildbox in ~/Development/buildbox on git:master
$ python -m timeit '(1 and "pass")'
10000000 loops, best of 3: 0.0438 usec per loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.