sup3r.utilities.utilities.Timer#

class Timer[source]#

Bases: object

Timer class for timing and storing function call times.

Methods

start()

Set start of timing period.

stop()

Set stop time of timing period.

Attributes

elapsed

Elapsed time between start and stop.

elapsed_str

Elapsed time in string format.

start()[source]#

Set start of timing period.

stop()[source]#

Set stop time of timing period.

property elapsed#

Elapsed time between start and stop.

property elapsed_str#

Elapsed time in string format.

__call__(func, call_id=None, log=False)[source]#

Time function call and store elapsed time in self.log.

Parameters:
  • func (function) – Function to time

  • call_id (int | None) – ID to distingush calls with the same function name. For example, when runnning forward passes on multiple chunks.

  • log (bool) – Whether to write to active logger

Returns:

output of func