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 is str, a new decorator is returned which uses arg in the generated message in places of the name of the decorated object.