import time

def myprof(func):

    def wrapping_fun(*args):
        start = time.clock()
result = func(*args)
end = time.clock()
print('Run time of %s is %4.2fs' % (func.__name__, end - start))
return result
return wrapping_fun
How to time how long a Python program takes to run?