Package io.pravega.common
Class AbstractTimer
- java.lang.Object
-
- io.pravega.common.AbstractTimer
-
- Direct Known Subclasses:
Timer
public abstract class AbstractTimer extends java.lang.ObjectProvides a customizable way of measuring elapsed time.
-
-
Field Summary
Fields Modifier and Type Field Description static intNANOS_TO_MILLIS
-
Constructor Summary
Constructors Constructor Description AbstractTimer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.time.DurationgetElapsed()Gets the elapsed time.longgetElapsedMillis()Gets the elapsed time, in milliseconds.abstract longgetElapsedNanos()Gets the elapsed time, in nanoseconds.java.lang.StringtoString()
-
-
-
Field Detail
-
NANOS_TO_MILLIS
public static final int NANOS_TO_MILLIS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getElapsedNanos
public abstract long getElapsedNanos()
Gets the elapsed time, in nanoseconds.- Returns:
- Long indicating elapsed time, in nanoseconds.
-
getElapsedMillis
public long getElapsedMillis()
Gets the elapsed time, in milliseconds.- Returns:
- Long indicating elapsed time, in milliseconds.
-
getElapsed
public java.time.Duration getElapsed()
Gets the elapsed time.- Returns:
- Duration indicating elapsed time.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-