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()
ClockcurrentTimeMicros in interface Clockpublic long currentNanoTicks()
ClockThis 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 Clockpublic boolean isMicrosAccurate()
isMicrosAccurate in interface ClockClock.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.