Package com.codahale.metrics
Class Clock
java.lang.Object
com.codahale.metrics.Clock
- Direct Known Subclasses:
Clock.CpuTimeClock
,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 thread's CPU time.static class
A clock implementation which returns the current time in epoch nanoseconds. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT
-
-
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:
-