Interface NanoClock (1.45.0)

public interface NanoClock

Nano clock which can be used to measure elapsed time in nanoseconds.

The default system implementation can be accessed at #SYSTEM. Alternative implementations may be used for testing.

Static Fields

SYSTEM

public static final NanoClock SYSTEM

Provides the default System implementation of a nano clock by using System#nanoTime().

Field Value
Type Description
NanoClock

Methods

nanoTime()

public abstract long nanoTime()

Returns the current value of the most precise available system timer, in nanoseconds for use to measure elapsed time, to match the behavior of System#nanoTime().

Returns
Type Description
long