Interface ApiClock (2.31.0)

public interface ApiClock

An interface for getting the current value of a high-resolution time source, in nanoseconds.

Clocks other than NanoClock are typically used only for testing.

This interface is required in addition to Java 8's Clock, because nanoTime is required to compare values with io.grpc.CallOptions.getDeadlineNanoTime().

Methods

millisTime()

public abstract long millisTime()

Returns the current value of this clock's high-resolution time source, in milliseconds.

Returns
Type Description
long

nanoTime()

public abstract long nanoTime()

Returns the current value of this clock's high-resolution time source, in nanoseconds.

Returns
Type Description
long