Base for a time counter that accumulates elapsed time via start/pause/toggle.
Subclasses decide what "zero" means and how the counted value is formatted.
Constructors
new
Starts stopped, at zero accumulated time.
SourceInstance methods
elapsed
Total accumulated time, including the running portion if any.
Sourcepause
Freezes the accumulated time so far. No-op if already paused.
Sourcepaused?
True when stopped with non-zero accumulated time.
Sourcerunning?
True while time is accumulating (not paused, not reset).
Sourcestart
Starts (or resumes) accumulating time. No-op if already running.
Sourcetoggle
Switches between start and pause depending on the current state.
Sourcezero?
True when the clock is in its initial state (subclass-defined).
Source