Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # a file timer
- #
- # Using Python 3
- # from the book learning python
- import time
- reps = 1000
- repslist = range(reps)
- def timer(func, *pargs, **kargs):
- start = time.clock()
- for i in repslist:
- ret = func(*pargs, **kargs)
- elapsed = time.clock() - start
- return (elapsed, ret)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement