public final class AccumulatedTimer extends Object implements AccumulatedTimerSupplier
AccumulatedTimerSupplier
.Constructor and Description |
---|
AccumulatedTimer()
Creates a new timer in the
StatisticState.UNAVAILABLE state. |
Modifier and Type | Method and Description |
---|---|
long |
getAccumulatedTimeMillis()
The accumulated time so far.
|
StatisticState |
getState()
Returns the current state of the supplier.
|
void |
pause()
Pauses the timer; time will not accumulate until the next call to
start() . |
AccumulatedTimerSupplier |
snapshot()
Creates a snapshot of this timer.
|
void |
start()
Starts the timer; time will begin to accumulate
|
void |
stop()
Stops the timer.
|
public AccumulatedTimer()
StatisticState.UNAVAILABLE
state.public StatisticState getState()
StatisticSupplier
getState
in interface StatisticSupplier
public void start()
IllegalStateException
- if the timer is already
started or has finishedpublic void pause()
start()
.public void stop()
finally
block.public long getAccumulatedTimeMillis()
AccumulatedTimerSupplier
AccumulatedTimerSupplier.getAccumulatedTimeMillis()
.
This value is undefined if the timer is StatisticState.UNAVAILABLE
.getAccumulatedTimeMillis
in interface AccumulatedTimerSupplier
public AccumulatedTimerSupplier snapshot()
AccumulatedTimerSupplier
StatisticState.ACTIVE
snapshot
in interface AccumulatedTimerSupplier
snapshot
in interface StatisticSupplier
Copyright © 2024 Actian Corporation. All rights reserved.