Package com.codahale.metrics
Class Clock
java.lang.Object
com.codahale.metrics.Clock
- Direct Known Subclasses:
Clock.UserTimeClock
An abstraction for how time passes. It is passed to
Timer
to track timing.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A clock implementation which returns the current time in epoch nanoseconds. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Clock
public Clock()
-
-
Method Details
-
getTick
public abstract long getTick()Returns the current time tick.- Returns:
- time tick in nanoseconds
-
getTime
public long getTime()Returns the current time in milliseconds.- Returns:
- time in milliseconds
-
defaultClock
The default clock to use.- Returns:
- the default
Clock
instance - See Also:
-