Package io.opencensus.internal
Class ZeroTimeClock
java.lang.Object
io.opencensus.common.Clock
io.opencensus.internal.ZeroTimeClock
A
Clock
that always returns 0.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ZeroTimeClock
private static final Timestamp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ZeroTimeClock
Returns aZeroTimeClock
.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 Details
-
INSTANCE
-
ZERO_TIMESTAMP
-
-
Constructor Details
-
ZeroTimeClock
private ZeroTimeClock()
-
-
Method Details
-
getInstance
Returns aZeroTimeClock
.- Returns:
- a
ZeroTimeClock
.
-
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.
-