timeit¶
-
class
tollan.utils.log.
timeit
(arg)[source]¶ Bases:
contextlib.ContextDecorator
Context decorator that logs the execution time of the decorated item.
- Parameters
- arg: object or str
If
arg
type isstr
, a new decorator is returned which usesarg
in the generated message in places of the name of the decorated object.