Class AbstractIntervalTimer (2.0.0)

public abstract class AbstractIntervalTimer 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.

Inheritance

java.lang.Object > AbstractIntervalTimer

Implements

Timer

Constructors

AbstractIntervalTimer()

public AbstractIntervalTimer()

Fields

cumulativeTime

protected long cumulativeTime
Field Value
Type Description
long

running

protected boolean running
Field Value
Type Description
boolean

startTime

protected long startTime
Field Value
Type Description
long

Methods

getCurrent()

protected abstract long getCurrent()
Returns
Type Description
long

getNanoseconds()

public long getNanoseconds()
Returns
Type Description
long

getRatio()

protected double getRatio()

The fraction of the change in the underlying counter which will be attributed to this timer. By default, 100% of it.

Returns
Type Description
double

start()

public synchronized void start()

stop()

public synchronized void stop()

update()

public synchronized void update()

update(long currentValue)

protected void update(long currentValue)
Parameter
Name Description
currentValue long