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 Details

    • isSystemCurrentTime

      public static boolean isSystemCurrentTime
      A 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 interface com.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

      public String toString()
      Overrides:
      toString in class Object