hybrid.profiling.make_timeit#

class make_timeit(timers, prefix=None, loglevel=None)[source]#

Generate timer increment context manager specialized for handling (bound to) timers in the provided timers dictionary.

Parameters:

timers (dict) – Timers storage.

Example:

timers = {}
timeit = make_timeit(timers)

for _ in range(10):
    with timeit('f'):
        f()

# timers['f'] is now a list holding 10 runtimes of `f`
__init__(timers, prefix=None, loglevel=None)[source]#

Methods

__init__(timers[, prefix, loglevel])