def duration(function, *args, **kwargs):
 t = time()
 function(*args, **kwargs)
 return (time() - t)

def duration ( function , * args , ** kwargs ) : t = time ( ) function ( * args , ** kwargs ) return ( time ( ) - t )
returns the running time of the given function .