import timeit t = timeit.Timer('bar.bar()', 'import bar') print(t.timeit(number=100000))