Clock class abstract
Monotonic clock that is not influenced by system time changes. The clock needs to be started using the start method
- Implementers
Constructors
- Clock.new()
- Empty default constructor
- Clock.agentClock()
-
Primary constructor that will return the best available time source for the given platform
Use the returned clock to get timestamps that are not influenced by system time changes.
factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
now(
) → DateTime - The current DateTime
-
nowMicros(
) → int - The current number of microseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
-
nowMillis(
) → int - The current number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
-
nowNanos(
) → int - The current number of nanoseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
-
start(
) → void - Start the clock calling any now before the clock is started will throw an exception!
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
stopWatch(
) → StopWatchClock - Creates a platform-optimized monotonic clock for measuring durations.
Constants
- nanosecondsPerMicrosecond → const int
- Number of ns per µs
- nanosecondsPerMillisecond → const int
- Number of ns per ms