com.espertech.esper.timer
Class TimeSourceService

java.lang.Object
  extended by com.espertech.esper.timer.TimeSourceService

public class TimeSourceService
extends Object

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
TimeSourceService()
          Ctor.
 
Method Summary
protected  long calculateResolution()
          Calculate resolution of this timer in microseconds i.e.
 long getTimeMillis()
          Convenience method to get time in milliseconds
 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

TimeSourceService

public TimeSourceService()
Ctor.

Method Detail

getTimeMillis

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

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

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com