hybrid.profiling.tictoc#

class tictoc(name=None, loglevel=10)[source]#

Instrument and log function execution duration.

Examples:

@tictoc('function', loglevel=logging.INFO)
def f(x, y):
    a = x * y
    with tictoc('block'):
        return [a * a for _ in range(x)]

class Example(object):
    @tictoc()
    def method(self, args):
        # ...
__init__(name=None, loglevel=10)[source]#

Methods

__init__([name, loglevel])

start()

stop()