| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Timer.Context
A timing context.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Timer.Context |
time()
Returns a new
Timer.Context. |
<T> T |
time(Callable<T> event)
Times and records the duration of event.
|
void |
update(long duration,
TimeUnit unit)
Adds a recorded duration.
|
getCount, getFifteenMinuteRate, getFiveMinuteRate, getInstantCount, getInstantCount, getInstantCountInterval, getMeanRate, getOneMinuteRatelastUpdateTimegetSnapshotvoid update(long duration,
TimeUnit unit)
duration - the length of the durationunit - the scale unit of 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 ExceptionTimer.Context time()
Timer.Context.Timer.ContextTimer.ContextCopyright © 2019. All rights reserved.