public interface Timer
| Modifier and Type | Interface and Description |
|---|---|
static class |
Timer.Builder |
static interface |
Timer.Sample
Maintains state on the clock's start position for a latency sample.
|
| Modifier and Type | Method and Description |
|---|---|
static Timer.Builder |
builder(String name) |
long |
count() |
default void |
record(long duration)
Updates the statistics kept by the counter with the specified
amount in nanoseconds.
|
void |
record(long duration,
TimeUnit unit)
Updates the statistics kept by the counter with the specified amount.
|
Timer.Sample |
start()
Returns a new
Timer.Sample. |
double |
totalTime(TimeUnit unit) |
static Timer.Builder builder(String name)
default void record(long duration)
duration - Duration of a single event being measured by this timer.void record(long duration,
TimeUnit unit)
duration - Duration of a single event being measured by this timer.unit - Time unit for the amount being recorded.double totalTime(TimeUnit unit)
unit - The base unit of time to scale the total to.long count()
Timer.Sample start()
Timer.Sample.Timer.SampleTimer.SampleCopyright © 2019. All rights reserved.