Package com.xceptance.xlt.api.engine
Class GlobalClock
java.lang.Object
com.xceptance.xlt.api.engine.GlobalClock
This is a centralized global clock. It automaticlaly is inited with the
default system clock.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Clock
get()
static Clock
You an install and clock based on the java.time.Clock class and make it the central clock.static Clock
installFixed
(long epochMillis) Install the fixed time clockstatic Clock
installWithOffset
(long offsetinMillis) Install a clock that has an offset.static long
millis()
static long
offset()
static Clock
reset()
Installs the default system clock again
-
Constructor Details
-
GlobalClock
public GlobalClock()
-
-
Method Details
-
get
-
millis
public static long millis() -
offset
public static long offset() -
install
You an install and clock based on the java.time.Clock class and make it the central clock.- Parameters:
clock
- the clock to use, can be even a static one for testing purposes- Returns:
- the new clock in case you want to chain
-
installWithOffset
Install a clock that has an offset. Make sure we remember the offset.- Parameters:
offsetinMillis
-- Returns:
-
installFixed
Install the fixed time clock- Parameters:
epochMillis
- the time to return when calling- Returns:
- the installed clocked
-
reset
Installs the default system clock again- Returns:
- the installed clock
-