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