I want to get the execution time of several portions of my code. Currently I am using time.time() but I feel a bit dumb when writing again and over again code like this:
start = time()
function1(args1)
print("Execution of function1: {}".format(time()-start))
start = time()
function2(args2)
print("Execution of function2: {}".format(time()-start))
start = time()
function3(args3)
print("Execution of function3: {}".format(time()-start))
Please do you know any smarter way to do this? I couldn't find any module that would enable to do things like this (for instance):
chrono("Execution of function1")
function1(args1)
chrono("Execution of function2")
function2(args2)
chrono("Execution of function3")
function3(args3)