Timer#

class pyvbmc.timer.Timer[source]#

A small Timer class used in the context of VBMC.

get_duration(name: str)[source]#

Return the duration of the specified timer.

Parameters:
namestr

The name of the timer which time should be returned.

Returns:
durationfloat

The duration of the timer or None when the timer is not existing.

reset()[source]#

Reset the timer be emptying the durations and start times.

start_timer(name: str)[source]#

Start the specified timer.

Parameters:
namestr

The name of the timer that should be started.

stop_timer(name: str)[source]#

Stop the specified timer.

If this is the first call to stop_timer(name) for string name, record the duration. Otherwise, add to the duration.

Parameters:
namestr

The name of the timer that should be started.