Package io.opencensus.implcore.common
Class MillisClock
- java.lang.Object
-
- io.opencensus.common.Clock
-
- io.opencensus.implcore.common.MillisClock
-
@ThreadSafe public final class MillisClock extends Clock
-
-
Field Summary
Fields Modifier and Type Field Description private static MillisClockINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateMillisClock()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MillisClockgetInstance()Returns aMillisClock.Timestampnow()Obtains the current instant from this clock.longnowNanos()Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
-
-
-
Field Detail
-
INSTANCE
private static final MillisClock INSTANCE
-
-
Method Detail
-
getInstance
public static MillisClock getInstance()
Returns aMillisClock.- Returns:
- a
MillisClock.
-
now
public Timestamp now()
Description copied from class:ClockObtains the current instant from this clock.
-
nowNanos
public long nowNanos()
Description copied from class:ClockReturns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
-
-