NeomStopwatch class
Singleton stopwatch manager supporting multiple independent references.
Used for:
- Audio: tracking listening time per media item (CaseteSession)
- Books: tracking total reading session + per-page duration (NupaleSession)
- Generator: tracking frequency chamber sessions
Each reference (e.g. media item ID, book name, page key) gets its own Stopwatch instance with accumulated time across pause/resume cycles.
Constructors
- NeomStopwatch()
-
factory
Properties
- currentReference ↔ String
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
commitLap(
{String? ref}) → void -
Resets the lap counter for
refand restarts timing from 0. Call this after the lap value has been safely captured. -
elapsed(
{String? ref}) → int -
Returns total elapsed seconds for
ref(accumulated + current if running). -
elapsedMilliseconds(
{String? ref}) → int -
Returns total elapsed milliseconds for
ref. -
isRunning(
{String? ref}) → bool -
Whether a stopwatch exists and is running for
ref. -
lap(
{String? ref}) → int -
Returns elapsed seconds for
refwithout resetting. Call commitLap after the value has been safely captured/stored. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
{String? ref}) → void -
Pauses the stopwatch for
refand accumulates elapsed time. -
reset(
{String? ref}) → void -
Resets the accumulated time for
refto 0 without removing the stopwatch. -
resume(
) → void -
start(
{String? ref}) → void -
Starts (or resumes) the stopwatch for
ref. -
stop(
{String? ref}) → int -
Stops the stopwatch for
refand returns total accumulated seconds. -
stopAndClear(
String ref) → int -
Stops, removes the stopwatch for
ref, and returns total seconds. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited