public abstract class Clock
extends java.lang.Object
Note that logging and calling arbitrary unknown code (which might log) are permitted inside the instance methods of this API, since they are not called during platform initialization. The easiest way to achieve this is to simply avoid having any non-trivial static fields or any instance fields at all in the implementation.
While this sounds onerous it's not difficult to achieve because this API is a singleton, and can delay any actual work until its methods are called. For example if any additional state is required in the implementation, it can be held via a "lazy holder" to defer initialization.
| Constructor and Description |
|---|
Clock() |
| Modifier and Type | Method and Description |
|---|---|
abstract long |
getCurrentTimeNanos()
Returns the current time from the epoch (00:00 1st Jan, 1970) with nanosecond granularity,
though not necessarily nanosecond precision.
|