class documentation

class ElapsedWCTime(object):

Constructor: ElapsedWCTime(time_offset)

View In Hierarchy

measure elapsed cumulative time while not paused and elapsed time since last tic.

Use attribute tic and methods pause () and reset () to control the timer. Use attributes toc and elapsed to see timing results.

>>> 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 while not paused, measured since creation or last reset
Property tic return toc and restart tic/toc last-round-timer.
Property toc return elapsed time since last tic
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 while not paused, measured since creation or last reset

@property
tic =

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

In case, also resume from pause.

@property
toc =

return elapsed time since last tic

_time_offset =

Undocumented