public interface EPEventServiceTimeControl
Modifier and Type | Method and Description |
---|---|
void |
advanceTime(long time)
Advance time by jumping to the given time in milliseconds (or nanoseconds if so configured).
|
void |
advanceTimeSpan(long time)
Advance time by continually-sliding to the given time in milliseconds (or nanoseconds if so configured) at the smallest resolution (non-hopping).
|
void |
advanceTimeSpan(long time,
long resolution)
Advance time by continually-sliding to the given time in milliseconds (or nanoseconds if so configured) at the provided resolution (hopping).
|
void |
clockExternal()
Switches off the internal timer which tracks system time.
|
void |
clockInternal()
Switches on the internal timer which tracks system time.
|
long |
getCurrentTime()
Returns current engine time.
|
Long |
getNextScheduledTime()
Returns the time at which the next schedule execution is expected, returns null if no schedule execution is
outstanding.
|
boolean |
isExternalClockingEnabled()
Returns true for external clocking, false for internal clocking.
|
void advanceTime(long time)
For externally controlling the time within a runtime.
External clocking must be first be enabled by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean)
passing false
or by calling clockExternal()
.
Time should never move backwards (unless for testing purposes where previous results can be thrown away)
time
- timevoid advanceTimeSpan(long time)
For externally controlling the time within a runtime.
External clocking must be first be enabled by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean)
passing false
or by calling clockExternal()
.
Time should never move backwards (unless for testing purposes where previous results can be thrown away)
time
- timevoid advanceTimeSpan(long time, long resolution)
For externally controlling the time within a runtime.
External clocking must be first be enabled by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean)
passing false
or by calling clockExternal()
.
Time should never move backwards (unless for testing purposes where previous results can be thrown away)
time
- timeresolution
- the resolution to uselong getCurrentTime()
If time is provided externally via timer events, the function returns current time as externally provided.
Long getNextScheduledTime()
void clockInternal()
Your application may not want to use advanceTime(long)
, advanceTimeSpan(long)
or advanceTimeSpan(long, long)
after calling this method, since time advances according to JVM time.
void clockExternal()
Your application may want to use advanceTime(long)
, advanceTimeSpan(long)
or advanceTimeSpan(long, long)
after calling this method to set or advance time.
Its generally preferable to turn off internal clocking (and thus turn on external clocking) by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean)
passing false.
boolean isExternalClockingEnabled()
Copyright © 2005–2018. All rights reserved.