irtk.utils.Timer

class irtk.utils.Timer(label: str, prt: bool = True, record: bool = True)

Timer to record and display operation elapsed time.

Typical usage is adding with Timer(): before the code block.

__init__(label: str, prt: bool = True, record: bool = True)

Initialize the timer.

Parameters:
  • label – A user defined label for the timer.

  • prt – Whether to print the time.

  • record – Whether to store the time in the timers dict for later retrieval. Time pieces with the same label are added together.

classmethod reset_timers()

Clear all recorded times in the timers dict.