| Modifier and Type | Interface and Description |
|---|---|
static interface |
Timer.Context
A timing context.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
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(Callable<T> event)
Times and records the duration of event.
|
void |
time(Runnable event)
Times and records the duration of event.
|
void |
update(Duration duration)
Adds a recorded duration.
|
void update(Duration duration)
duration - the length of the duration<T> T time(Callable<T> event) throws Exception
T - the type of the value returned by eventevent - a Callable whose Callable.call() method implements a process whose duration should be
timedeventException - if event throws an Exceptionvoid time(Runnable event)
event - a Runnable whose Runnable.run() method implements a process whose duration should be
timedTimer.Context time()
Timer.Context.Timer.ContextTimer.ContextDuration getElapsedTime()
update(Duration).durationlong getCount()
Snapshot getSnapshot()
SamplinggetSnapshot in interface SamplingCopyright © 2017 – 2022 Eclipse Foundation. All rights reserved.
Use is subject to license terms.