class

Cresium::Timer

Inherits Cresium::Clock < Reference < Object

Counts down from a duration set at setup time, with pause/reset.

Constructors

new

Starts unset (zero? true), with no duration.

Source

Instance methods

expired?

True once the countdown has reached zero (requires being set).

Source
format(with_millis : Bool = true) : String

Time remaining as hh:mm:ss[.fff].

Source
paused?

True when set, stopped, and not yet expired.

Source
remaining

Time left before expiration, never negative.

Source
reset

Unsets the timer and clears its duration and accumulated time.

Source
set(duration : Time::Span) : Nil

Sets the countdown duration and (re)initializes the clock, stopped. Can be called again on an already-set timer to change the duration.

Source
set?

True once set is called; false after reset. start is a no-op until set.

Source
start

No-op until set has been called (unlike Clock#start).

Source
zero?

True when the timer has no duration set yet.

Source