sup3r.utilities.utilities.Timer#
- class Timer[source]#
Bases:
object
Timer class for timing and storing function call times.
Methods
Attributes
Elapsed time between start and stop.
Elapsed time in string format.
- 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