Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Returns a tuple. The return of the function and the time it tookto execute.
- """
- from time import time
- def bench(f):
- def nf(*args,**kwargs):
- t = time()
- r = f(*args,**kwargs)
- t = time() - t
- return r,t
- nf.__name__ = f.__name__
- return nf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement