[ create a new paste ] login | about

Link: http://codepad.org/NJY9R3Q1    [ raw code | output | fork ]

python@2ch - Python, pasted on Jun 28:
1
2
3
4
5
6
7
8
9
10
from timeit import Timer

print Timer('bool(1)').timeit()
#0.42471152059828832

print Timer('1 and True or False').timeit()
#0.12050051053974897

print Timer('1!=0').timeit()
#0.17648332399788202


Output:
1
2
3
1.01151394844
0.263537883759
0.285307884216


Create a new paste based on this one


Comments: