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 MillisClock
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
MillisClock()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MillisClock
getInstance()
Returns aMillisClock
.Timestamp
now()
Obtains the current instant from this clock.long
nowNanos()
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:Clock
Obtains the current instant from this clock.
-
nowNanos
public long nowNanos()
Description copied from class:Clock
Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
-
-