imate.Timer.reset#

Timer.reset()#

Resets time counters.

This function is used when an instance of this class should be reused again from fresh settings.

Examples

>>> # Load Timer class
>>> from imate import Timer

>>> # Instantiate a timer object
>>> timer = Timer()

>>> # Start tracking time
>>> timer.tic()

>>> # do something time-consuming
>>> from imate import toeplitz, logdet
>>> A = toeplitz(2, 1, size=1000000, gram=True)
>>> ld, info = logdet(A, method='slq', return_info=True)

>>> # Register a time-stamp right here in the code
>>> timer.toc()

>>> # Read wall time
>>> timer.wall_time
2.727652072906494

>>> # Read process time
>>> timer.proc_time
17.752098541000002

>>> # Reset timer
>>> timer.reset()

# By resetting, all attributes of the object set back to zero
>>> timer.wall_time
0.0

>>> time.proc_time
0.0