| Modifier and Type | Interface and Description |
|---|---|
static interface |
Timer.Context
A timing context.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
java.time.Duration |
getElapsedTime()
Returns the total elapsed timing durations of all completed timing events that are recorded with
update(Duration). |
Snapshot |
getSnapshot()
Returns a snapshot of the values.
|
Timer.Context |
time()
Returns a new
Timer.Context. |
<T> T |
time(java.util.concurrent.Callable<T> event)
Times and records the duration of event.
|
void |
time(java.lang.Runnable event)
Times and records the duration of event.
|
void |
update(java.time.Duration duration)
Adds a recorded duration.
|
void update(java.time.Duration duration)
duration - the length of the duration<T> T time(java.util.concurrent.Callable<T> event)
throws java.lang.Exception
T - the type of the value returned by eventevent - a Callable whose Callable.call() method implements a process whose duration should be
timedeventjava.lang.Exception - if event throws an Exceptionvoid time(java.lang.Runnable event)
event - a Runnable whose Runnable.run() method implements a process whose duration should be
timedTimer.Context time()
Timer.Context.Timer.ContextTimer.Contextjava.time.Duration getElapsedTime()
update(Duration).durationlong getCount()
Snapshot getSnapshot()
SamplinggetSnapshot in interface Sampling