public final class IntervalTimer extends AbstractIntervalTimerSupplier
AccumulatedTimerSupplier
.Constructor and Description |
---|
IntervalTimer()
Creates a new timer in the
StatisticState.UNAVAILABLE state. |
Modifier and Type | Method and Description |
---|---|
long |
getEndTimeMillis()
Returns the end time if finished, the current time if running, or an undefined value if never started.
|
long |
getStartTimeMillis()
This will return the start time or an undefined value if never started.
|
StatisticState |
getState()
Returns the current state of the supplier.
|
IntervalTimerSnapshot |
snapshot()
Creates a snapshot of this timer.
|
void |
start()
Starts the timer; time will begin to accumulate
|
void |
stop()
Stops the timer.
|
getTimeIntervalMillis
public IntervalTimer()
StatisticState.UNAVAILABLE
state.public StatisticState getState()
StatisticSupplier
public void start()
IllegalStateException
- if the timer is already
started or has finishedpublic void stop()
finally
block.public IntervalTimerSnapshot snapshot()
IntervalTimerSupplier
StatisticState.ACTIVE
public long getStartTimeMillis()
IntervalTimerSupplier
public long getEndTimeMillis()
IntervalTimerSupplier
StatisticState.ACTIVE
state, then this value will reflect the time at which
the snapshot was taken.Copyright © 2016 Actian Corporation. All rights reserved.