jgdv.debugging.timing

See EOF for license/metadata/notes as applicable

Classes

TimeCtx

Utility Class to time code execution.

TimeDec

Decorate a callable to track its timing

Module Contents

class jgdv.debugging.timing.TimeCtx(
*,
logger=None,
level=logmod.INFO,
group=None,
)[source]

Utility Class to time code execution.

Parameters:
_set_name(name) <Unknown>[source]
Parameters:

name (jgdv.Maybe[str])

Return type:

None

msg(msg, *args) <Unknown>[source]
Parameters:
  • msg (str)

  • args (Any)

Return type:

None

_logger: jgdv.Maybe[logging.Logger]
_start: int
_stop: int
group: str
level: int
total: int
total_ms: float
total_s: float
class jgdv.debugging.timing.TimeDec(
*,
cache=None,
logger=None,
level=None,
**kwargs,
)[source]

Bases: jgdv.decorators.MonotonicDec

Decorate a callable to track its timing

Parameters:
_wrap_fn_h(fn) <Unknown>[source]

override this to add a decorator to a function

Parameters:

fn (jgdv.Func[TimeDec._wrap_fn_h.I, TimeDec._wrap_fn_h.O])

Return type:

jgdv.Func[TimeDec._wrap_fn_h.I, TimeDec._wrap_fn_h.O]

_wrap_method_h(fn) <Unknown>[source]

Override this to add a decoration function to method

Parameters:

fn (jgdv.Func[TimeDec._wrap_method_h.I, TimeDec._wrap_method_h.O])

Return type:

jgdv.Func[TimeDec._wrap_method_h.I, TimeDec._wrap_method_h.O]

_cache: jgdv.Maybe[pathlib.Path]
_level = None
_logger: jgdv.Maybe[logging.Logger]