icecube.ml_suite.time_boss module

class icecube.ml_suite.time_boss.TimeBoss(name: str)

Bases: object

Implements timing via context managers.

Usage:

with TimeBoss("timer1"):
    # computation
    with TimeBoss("timer2"):
        # more computation
TimeBoss.result()
add_timer(timer: TimeBoss)

Add a subtimer

all_timers: dict[str, TimeBoss] = {}
classmethod plot_results()
static print_res(timer: TimeBoss, unit: str, level: int)

Pretty print the timing result

classmethod result(unit='s')

Print the results of all timers

root_timers: list[TimeBoss] = []
timer_stack: list[TimeBoss] = []
unit_conv = {'ms': 1000.0, 'mus': 1000000.0, 's': 1}