X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=stopwatch.py;h=fa4f2b52f54998bb029f7e14433e5451abd67812;hb=e8fbbb7306430478dec55d2c963eed116d8330cc;hp=516138c50fadb3fc71f29ffe8bf9e29169ddff3c;hpb=6cf1d61b80d02937dbca9025c1922568d42a8c73;p=python_utils.git diff --git a/stopwatch.py b/stopwatch.py index 516138c..fa4f2b5 100644 --- a/stopwatch.py +++ b/stopwatch.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""A simple stopwatch decorator / context for timing things.""" + import time from typing import Callable, Optional @@ -10,7 +12,7 @@ class Timer(object): e.g. - with timer.Timer() as t: + with stopwatch.Timer() as t: do_the_thing() walltime = t()