public abstract class Timer0 extends Object implements com.google.gerrit.extensions.registration.RegistrationHandle
Typical usage in a try-with-resources block:
try (Timer.Context ctx = timer.start()) { }
Modifier and Type | Class and Description |
---|---|
static class |
Timer0.Context |
Constructor and Description |
---|
Timer0() |
Modifier and Type | Method and Description |
---|---|
abstract void |
record(long value,
TimeUnit unit)
Record a value in the distribution.
|
Timer0.Context |
start()
Begin a timer for the current block, value will be recorded when closed.
|
public Timer0.Context start()
public abstract void record(long value, TimeUnit unit)
value
- value to recordunit
- time unit of the value