class documentation

class ElapsedWCTime(object):

Constructor: ElapsedWCTime(time_offset)

View In Hierarchy

measure elapsed cumulative time while not paused since creation.

To control the timer, use attribute tic and methods pause () and reset (). To see timing results, use attributes toc (since last tic) and elapsed (since creation).

>>> import cma
>>> e = cma.utilities.utils.ElapsedWCTime().pause()  # (re)start later
>>> assert e.paused and e.elapsed == e.toc < 0.1
>>> assert e.toc == e.tic < 0.1  # timer starts here
>>> assert e.toc <= e.tic  # toc is usually a few microseconds smaller
>>> assert not e.paused    # the timer is now running due to tic

Details: the attribute paused equals to the time [s] when paused or to zero when the timer is running.

Method __call__ depreciated return elapsed time (for backwards compatibility)
Method __init__ add time offset in seconds and start timing
Method pause pause timer, resume with tic
Method reset reset to initial state and start timing
Instance Variable cum_time Undocumented
Instance Variable last_tic Undocumented
Instance Variable paused time when paused or 0 while running
Property elapsed elapsed time since last reset while not paused.
Property tic return toc and restart tic/toc last-round-timer.
Property toc elapsed time since last tic or pause call
Property wallclock never used: time between last reset and last toc (i.e. last usage)
Instance Variable _last_toc Undocumented
Instance Variable _time_at_creation Undocumented
Instance Variable _time_at_reset Undocumented
Instance Variable _time_offset Undocumented
def __call__(self):

depreciated return elapsed time (for backwards compatibility)

def __init__(self, time_offset=0):

add time offset in seconds and start timing

def pause(self):

pause timer, resume with tic

def reset(self):

reset to initial state and start timing

cum_time =

Undocumented

last_tic =

Undocumented

paused =

time when paused or 0 while running

@property
elapsed =

elapsed time since last reset while not paused.

Details: this triggers a toc call.

@property
tic =

return toc and restart tic/toc last-round-timer.

In case, also resume from pause.

@property
toc =

elapsed time since last tic or pause call

@property
wallclock =

never used: time between last reset and last toc (i.e. last usage)

_last_toc =

Undocumented

_time_at_creation =

Undocumented

_time_at_reset =

Undocumented

_time_offset =

Undocumented