public class SystemClock extends java.lang.Object implements Clock
The actual timestamp generation implementation for both scenarios can be
found in MicrosAccurateClock
and MillisAccurrateClock
.
Constructor and Description |
---|
SystemClock() |
Modifier and Type | Method and Description |
---|---|
long |
currentNanoTicks()
Returns the current value of the running Java Virtual Machine's high-resolution time source, in
nanoseconds.
|
long |
currentTimeMicros()
Returns the current time in microseconds.
|
boolean |
isMicrosAccurate() |
public long currentTimeMicros()
Clock
currentTimeMicros
in interface Clock
public long currentNanoTicks()
Clock
This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time.
currentNanoTicks
in interface Clock
public boolean isMicrosAccurate()
isMicrosAccurate
in interface Clock
Clock.currentTimeMicros()
is accurate enough to
calculate span duration as (end-start). If this method returns false, the JaegerTracer
will
use Clock.currentNanoTicks()
for calculating duration instead.