InstantStopwatch class

An alternative to the built in Stopwatch class.

This doesn't run in the background and instead uses time comparisons, which saves a LOT of memory.

It's also more somewhat more sane than the traditional.

Constructors

InstantStopwatch({int fromMS: 0})
Constructs the stopwatch. If you want the stopwatch to begin at a certain time, pass a millisecond amount to start at.

Properties

stopwatchInDays int
Returns the time that the stopwatch has recorded as elapsed in days.
read-only
stopwatchInHours int
Returns the time that the stopwatch has recorded as elapsed in hours.
read-only
stopwatchInMilliseconds int
Returns the time that the stopwatch has recorded as elapsed in milliseconds.
read-only
stopwatchInMinutes int
Returns the time that the stopwatch has recorded as elapsed in minutes.
read-only
stopwatchInMonths int
Returns the time that the stopwatch has recorded as elapsed in months.
read-only
stopwatchInSeconds int
Returns the time that the stopwatch has recorded as elapsed in seconds.
read-only
stopwatchInWeeks int
Returns the time that the stopwatch has recorded as elapsed in weeks.
read-only
stopwatchValue Duration
Returns the time that the stopwatch has recorded as elapsed as a Duration.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

isRunning() bool
Returns true if the stopwatch is playing and false if paused.
pause() → void
Pauses the stopwatch. It will now remain paused at the latest time.
play() → void
Starts the stopwatch. It will now count upward in increments of 1 millisecond.
reset() → void
Resets stopwatch back to zero.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited