Class AbstractIntervalTimer (5.0.3)
Stay organized with collections
Save and categorize content based on your preferences.
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.
Constructors
AbstractIntervalTimer()
public AbstractIntervalTimer()
Fields
cumulativeTime
protected long cumulativeTime
| Field Value |
| Type |
Description |
long |
|
running
protected boolean running
| Field Value |
| Type |
Description |
boolean |
|
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
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-03 UTC.
[null,null,["Last updated 2026-06-03 UTC."],[],[]]