class

Cresium::Clock

Inherits Reference < Object

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.

Source

Instance methods

elapsed

Total accumulated time, including the running portion if any.

Source
format(with_millis : Bool = true) : String

Textual hh:mm:ss[.fff] representation of the displayed value.

Source
pause

Freezes the accumulated time so far. No-op if already paused.

Source
paused?

True when stopped with non-zero accumulated time.

Source
running?

True while time is accumulating (not paused, not reset).

Source
start

Starts (or resumes) accumulating time. No-op if already running.

Source
toggle

Switches between start and pause depending on the current state.

Source
zero?

True when the clock is in its initial state (subclass-defined).

Source