def wrapper(*args, **kwds):
    start = time()
result = f(*args, **kwds)
elapsed = time() - start
print('%s took %d time to finish' % (f.__name__, elapsed))
return result
return wrapper
how to measure execution time of functions (automatically) in Python