Interface TimingSource
public interface TimingSource
- Since:
- 4.1
- Author:
- Sanne Grinovero (C) 2012 Red Hat Inc.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Needs to be invoked at least once beforemonotonicTimeEstimate()
can be used.long
Returns an approximation ofSystem.nanoTime()
.long
nanoTime()
Returns current system time in nanoseconds.void
stop()
Invoked on engine integration shutdown.
-
Method Details
-
monotonicTimeEstimate
long monotonicTimeEstimate()Returns an approximation ofSystem.nanoTime()
. Performance should be preferred over accuracy by the implementation, but the value is monotonic and expresses time in milliseconds, however, subsequent invocations could return the same value.- Returns:
- an increasing value related to time in milliseconds. Only meaningful to compare time intervals, with no guarantees of high precision.
-
stop
void stop()Invoked on engine integration shutdown. There is no start method as it's expected to be lazily initialized -
ensureTimeEstimateIsInitialized
void ensureTimeEstimateIsInitialized()Needs to be invoked at least once beforemonotonicTimeEstimate()
can be used. Safe to be invoked multiple times. -
nanoTime
long nanoTime()Returns current system time in nanoseconds. Accuracy is preferred over performance by the implementation.- Returns:
- high precision current time in nanoseconds.
-