lenskit.logging.Stopwatch#

class lenskit.logging.Stopwatch(start=True)#

Timer class for recording elapsed wall time in operations.

acc_time: float | None = None#
start_time: float | None = None#
stop_time: float | None = None#
start()#
stop()#
elapsed(*, accumulated=True)#

Get the elapsed time.

Return type:

float

measure(accumulate=False)#

Context manager to measure an item, optionally accumulating its time.

Parameters:

accumulate (bool)

__str__()#
__repr__()#