com.espertech.esper.metrics.codahale_metrics.metrics.core
Class Clock

java.lang.Object
  extended by com.espertech.esper.metrics.codahale_metrics.metrics.core.Clock
Direct Known Subclasses:
Clock.CpuTimeClock, Clock.UserTimeClock

public abstract class Clock
extends java.lang.Object

An abstraction for how time passes. It is passed to Timer to track timing.


Nested Class Summary
static class Clock.CpuTimeClock
          A clock implementation which returns the current thread's CPU time.
static class Clock.UserTimeClock
          A clock implementation which returns the current time in epoch nanoseconds.
 
Constructor Summary
Clock()
           
 
Method Summary
static Clock defaultClock()
          The default clock to use.
abstract  long tick()
          Returns the current time tick.
 long time()
          Returns the current time in milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clock

public Clock()
Method Detail

tick

public abstract long tick()
Returns the current time tick.

Returns:
time tick in nanoseconds

time

public long time()
Returns the current time in milliseconds.

Returns:
time in milliseconds

defaultClock

public static Clock defaultClock()
The default clock to use.

Returns:
the default Clock.UserTimeClock instance

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