Clock class

Object for keeping track of time. This uses DateTime.now().millisecondsSinceEpoch.

Constructors

Clock([bool autoStart = true])
/ autoStart — (optional) whether to automatically start the clock when getDelta is called for the first time. Default is true.

Properties

autoStart ↔ bool
getter/setter pair
elapsedTime ↔ double
getter/setter pair
fps ↔ int
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
oldTime ↔ int
getter/setter pair
running ↔ bool
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startTime ↔ int
getter/setter pair

Methods

getDelta() → double
Get the seconds passed since the time oldTime was set and sets oldTime to the current time.
getElapsedTime() → double
Get the seconds passed since the clock started and sets oldTime to the current time.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → void
Starts clock. Also sets the startTime and oldTime to the current time, sets elapsedTime to 0 and running to true.
stop() → void
Stops clock and sets page:Clock.oldTime oldTime to the current time.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited