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 event
event
- a Callable
whose Callable.call()
method implements a process
whose duration should be timedevent
Exception
- if event
throws an Exception
void time(Runnable event)
event
- a Runnable
whose Runnable.run()
method implements a process
whose duration should be timedSimpleTimer.Context time()
SimpleTimer.Context
.SimpleTimer.Context
SimpleTimer.Context
Duration getElapsedTime()
update(Duration)
.duration
Copyright © 2020. All rights reserved.