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
import timeit | |
repeat = 7 | |
numbers = 1000 | |
# repeat = numbers = 1 # uncomment to count cmp and equal calls | |
def time(statement, _setup=None): | |
print min( | |
timeit.Timer(statement, setup=_setup or setup).repeat(repeat, numbers)) |