| Modifier and Type | Interface and Description |
|---|---|
static interface |
SimpleTimer.Context
A timing context.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount()
Returns the current count.
|
Duration |
getElapsedTime()
Returns the total elapsed timing durations of all completed timing events that are recorded with
update(Duration). |
SimpleTimer.Context |
time()
Returns a new
SimpleTimer.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 timedSimpleTimer.Context time()
SimpleTimer.Context.SimpleTimer.ContextSimpleTimer.ContextDuration getElapsedTime()
update(Duration).durationCopyright © 2020. All rights reserved.