Skip to main content
Version: Java (Groovy)

setClock

setClock sets the clock used to compute the current time. This allows a custom clock to be used instead of the current system clock. This is mainly used for replay simulations.

Syntax

setClock(clock)

Parameters

ParameterTypeDescription
clockClock

The clock to use.

Returns

Sets the clock.

Examples

The following example sets the clock to the current clock used by the system.

setClock(currentClock())