import time
def benchmark(func):
def wrapped():
start_time = time.clock()
res = func()
print('benchmark:', time.clock() - start_time)
return res
@benchmark
def main():
print('qwerty')
if __name__ == "__main__":
main()
$ python index2.py
Traceback (most recent call last):
File "index2.py", line 18, in
main()
TypeError: 'NoneType' object is not callable