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
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stopwatchInDays → int
-
Returns the time that the stopwatch has recorded as elapsed in days.
no setter
- stopwatchInHours → int
-
Returns the time that the stopwatch has recorded as elapsed in hours.
no setter
- stopwatchInMilliseconds → int
-
Returns the time that the stopwatch has recorded as elapsed in milliseconds.
no setter
- stopwatchInMinutes → int
-
Returns the time that the stopwatch has recorded as elapsed in minutes.
no setter
- stopwatchInMonths → int
-
Returns the time that the stopwatch has recorded as elapsed in months.
no setter
- stopwatchInSeconds → int
-
Returns the time that the stopwatch has recorded as elapsed in seconds.
no setter
- stopwatchInWeeks → int
-
Returns the time that the stopwatch has recorded as elapsed in weeks.
no setter
- stopwatchValue → Duration
-
Returns the time that the stopwatch has recorded as elapsed as a Duration.
no setter
Methods
-
isRunning(
) → bool - Returns true if the stopwatch is playing and false if paused.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited