public abstract class AbstractIntervalTimer extends Object implements Timer
AbstractIntervalTimer is common base class for Timer implementations that base measure the change in some value
between the point where the timer is started and the point where
the timer is stopped.
This class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
protected long |
cumulativeTime |
protected boolean |
running |
protected long |
startTime |
| Constructor and Description |
|---|
AbstractIntervalTimer() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract long |
getCurrent() |
long |
getNanoseconds() |
protected double |
getRatio()
The fraction of the change in the underlying counter which will
be attributed to this timer.
|
void |
start() |
void |
stop() |
void |
update() |
protected void |
update(long currentValue) |
protected boolean running
protected long startTime
protected long cumulativeTime
public long getNanoseconds()
getNanoseconds in interface Timerprotected double getRatio()
protected void update(long currentValue)
protected abstract long getCurrent()
Copyright © 2014. All Rights Reserved.