com.yammer.metrics.core
Class Clock
java.lang.Object
com.yammer.metrics.core.Clock
- Direct Known Subclasses:
- Clock.CpuTime, Clock.UserTime
public abstract class Clock
- extends Object
An abstraction for how time passes. It is passed to TimerMetric to track timing.
|
Field Summary |
static Clock |
DEFAULT
The default clock to use. |
|
Constructor Summary |
Clock()
|
|
Method Summary |
abstract long |
tick()
Gets the current time tick |
long |
time()
Gets the current time in milliseconds |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT
public static final Clock DEFAULT
- The default clock to use.
Clock
public Clock()
tick
public abstract long tick()
- Gets the current time tick
- Returns:
- time tick in nanoseconds
time
public long time()
- Gets the current time in milliseconds
- Returns:
- time in milliseconds
Copyright © 2011. All Rights Reserved.