public class IntervalTimer extends Object implements Resource
Modifier and Type | Field and Description |
---|---|
private long |
accum_time |
private String |
name |
private boolean |
running |
private long |
start |
private long |
stop |
private long |
time |
Constructor and Description |
---|
IntervalTimer()
Construct a new
IntervalTimer . |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear a timer.
|
String |
getName()
Get the name for this timer.
|
long |
getTime()
Get the accumulated time for the timer.
|
boolean |
isRunning()
Determine if the timer is currently running.
|
void |
release()
Release the timer.
|
void |
reserve()
Reserve the timer.
|
void |
resume()
Resume a stopped timer.
|
void |
setName(String name)
Set the name for this timer.
|
void |
start()
Start the timer.
|
void |
stop()
Stop the timer.
|
String |
toString()
Create a string representation of the timer, which includes its name
and accumulated time.
|
private long start
private long stop
private long time
private long accum_time
private boolean running
public IntervalTimer()
IntervalTimer
.public void setName(String name)
name
- The new name for the timer.public boolean isRunning()
true
if the timer is running and false
otherwise.public void start()
public void stop()
public void resume()
public void clear()
public long getTime()
-1
if the timer is currently running.public String toString()
public void reserve()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses