Chronometer class

A Chronometer useful for benchmarks.

Implemented types

Constructors

Chronometer([String name = 'Chronometer'])

Properties

elapsedTime Duration
Elapsed time (stopTime - startTime).
no setter
elapsedTimeMs int
Elapsed time in milliseconds (stopTime - startTime).
no setter
elapsedTimeSec double
Elapsed time in seconds (stopTime - startTime).
no setter
failedOperations int
Failed operations performed while this chronometer was running.
getter/setter pair
failedOperationsAsString String
no setter
hashCode int
The hash code for this object.
no setterinherited
hertz double
Returns the operations hertz: The average operations per second of the period (elapsedTimeSec) of this chronometer.
no setter
hertzAsString String
no setter
name String
The name/title of this chronometer.
getter/setter pair
operations int
Operations performed while this chronometer was running. Used to compute hertz.
getter/setter pair
operationsAsString String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startTime DateTime?
The start DateTime of this chronometer.
no setter
stopTime DateTime?
The stop DateTime of this chronometer.
no setter

Methods

compareTo(Chronometer other) int
Compares this object to another object.
override
computeHertz(int operations) double
Computes hertz for n operations.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets this chronometer for a future start and stop.
start() Chronometer
Starts the chronometer.
stop({int? operations, int? failedOperations}) Chronometer
Stops the chronometer.
toString() String
Returns a String with information of this chronometer: Example:
override

Operators

operator +(Chronometer other) Chronometer
operator ==(Object other) bool
The equality operator.
inherited