class documentation
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 |
Undocumented |
Instance Variable | last |
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 |
Undocumented |