com.espertech.esper.timer
Class TimeSourceServiceImpl

java.lang.Object
  extended by com.espertech.esper.timer.TimeSourceServiceImpl
All Implemented Interfaces:
TimeSourceService

public class TimeSourceServiceImpl
extends java.lang.Object
implements 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
static boolean IS_SYSTEM_CURRENT_TIME
          A public variable indicating whether to use the System millisecond time or nano time, to be configured through the engine settings.
 
Constructor Summary
TimeSourceServiceImpl()
          Ctor.
 
Method Summary
protected  long calculateResolution()
          Calculate resolution of this timer in microseconds i.e.
 long getTimeMillis()
          Convenience method to get time in milliseconds
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IS_SYSTEM_CURRENT_TIME

public static boolean IS_SYSTEM_CURRENT_TIME
A public variable indicating whether to use the System millisecond time or nano time, to be configured through the engine settings.

Constructor Detail

TimeSourceServiceImpl

public TimeSourceServiceImpl()
Ctor.

Method Detail

getTimeMillis

public long getTimeMillis()
Convenience method to get time in milliseconds

Specified by:
getTimeMillis in interface 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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com