Class TimeSourceServiceImpl
java.lang.Object
com.espertech.esper.runtime.internal.timer.TimeSourceServiceImpl
- All Implemented Interfaces:
com.espertech.esper.common.internal.schedule.TimeSourceService
public class TimeSourceServiceImpl
extends Object
implements com.espertech.esper.common.internal.schedule.TimeSourceService
Allow for different strategies for getting VM (wall clock) time.
See JIRA issue ESPER-191 Support nano/microsecond resolution for more
information on Java system time-call performance, accuracy and drift.
- Author:
- Jerry Shea
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
A public variable indicating whether to use the System millisecond time or nano time, to be configured through the runtimesettings. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
Calculate resolution of this timer in microseconds i.e.long
Convenience method to get time in millisecondstoString()
-
Field Details
-
isSystemCurrentTime
public static boolean isSystemCurrentTimeA public variable indicating whether to use the System millisecond time or nano time, to be configured through the runtimesettings.
-
-
Constructor Details
-
TimeSourceServiceImpl
public TimeSourceServiceImpl()Ctor.
-
-
Method Details
-
getTimeMillis
public long getTimeMillis()Convenience method to get time in milliseconds- Specified by:
getTimeMillis
in interfacecom.espertech.esper.common.internal.schedule.TimeSourceService
- Returns:
- wall-clock time in milliseconds
-
calculateResolution
protected long calculateResolution()Calculate resolution of this timer in microseconds i.e. what is the resolution of the underlying platform's timer.- Returns:
- timer resolution
-
toString
-