Top Description Fields Methods
io.github.resilience4j.core

public Interface Clock


A clock abstraction used to measure absolute and relative time.

Field Summary

Modifier and TypeField and Description
public static final Clock

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

monotonic time in nanoseconds
monotonicTime
()

Current monotonic time in nanoseconds.

public long

Returns:

wall time in milliseconds
wallTime
()

Current time expressed as milliseconds since the Unix epoch.

Field Detail

SYSTEMback to summary
public static final Clock SYSTEM

Method Detail

monotonicTimeback to summary
public long monotonicTime()

Current monotonic time in nanoseconds. Should be used for measuring time. The value is not related to the wall time and is not subject to system clock changes.

Returns:long

monotonic time in nanoseconds

wallTimeback to summary
public long wallTime()

Current time expressed as milliseconds since the Unix epoch. Should not be used for measuring time, just for timestamps.

Returns:long

wall time in milliseconds