projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More cleanup, yey!
[python_utils.git]
/
stopwatch.py
diff --git
a/stopwatch.py
b/stopwatch.py
index 516138c50fadb3fc71f29ffe8bf9e29169ddff3c..fa4f2b52f54998bb029f7e14433e5451abd67812 100644
(file)
--- a/
stopwatch.py
+++ b/
stopwatch.py
@@
-1,5
+1,7
@@
#!/usr/bin/env python3
#!/usr/bin/env python3
+"""A simple stopwatch decorator / context for timing things."""
+
import time
from typing import Callable, Optional
import time
from typing import Callable, Optional
@@
-10,7
+12,7
@@
class Timer(object):
e.g.
e.g.
- with
timer
.Timer() as t:
+ with
stopwatch
.Timer() as t:
do_the_thing()
walltime = t()
do_the_thing()
walltime = t()