public abstract class AbstractTimer extends AbstractMeter implements Timer
Timer.BuilderMeter.Id, Meter.Type| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTimer(Meter.Id id,
Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
void |
record(java.lang.Runnable f)
Executes the runnable `f` and records the time taken.
|
<T> T |
record(java.util.function.Supplier<T> f)
Executes the Supplier `f` and records the time taken.
|
<T> T |
recordCallable(java.util.concurrent.Callable<T> f)
Executes the callable `f` and records the time taken.
|
<T> java.util.concurrent.Callable<T> |
wrap(java.util.concurrent.Callable<T> f)
Wrap a
Callable so that it is timed when invoked. |
getIdclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitprotected Clock clock
public <T> T recordCallable(java.util.concurrent.Callable<T> f)
throws java.lang.Exception
TimerrecordCallable in interface Timerf - Function to execute and measure the execution time.java.lang.Exceptionpublic <T> T record(java.util.function.Supplier<T> f)
Timerpublic <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> f)
TimerCallable so that it is timed when invoked.public void record(java.lang.Runnable f)
Timerpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object