Package io.opencensus.common
Class Clock
java.lang.Object
io.opencensus.common.Clock
- Direct Known Subclasses:
MillisClock
,TestClock
,ZeroTimeClock
Interface for getting the current time.
- Since:
- 0.5
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Clock
public Clock()
-
-
Method Details
-
now
Obtains the current instant from this clock.- Returns:
- the current instant.
- Since:
- 0.5
-
nowNanos
public abstract long nowNanos()Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.- Returns:
- a time measurement with nanosecond precision that can only be used to calculate elapsed time.
- Since:
- 0.5
-