public class Timer
extends java.lang.Object
Timer instances can be obtained from a global cache implemented in TimerPool
.
TimerPool
Modifier and Type | Method and Description |
---|---|
void |
dump(java.util.logging.Logger logger)
Dump the timer.
|
double |
getAverageTime()
Gets the average time for this timer in milliseconds
|
long |
getCount()
Gets the count of starts for this timer
|
long |
getCurTime()
Returns the latest time gathered
|
long |
getMaxTime()
Gets the max time for this timer in milliseconds
|
long |
getMinTime()
Gets the min time for this timer in milliseconds
|
java.lang.String |
getName()
Retrieves the name of the timer
|
boolean |
isStarted()
Returns true if the timer has started.
|
void |
reset()
Resets the timer as if it has never run before.
|
void |
start()
Starts the timer running.
|
void |
start(long time)
Starts the timer at the given time.
|
long |
stop()
Stops the timer.
|
public java.lang.String getName()
public void reset()
public boolean isStarted()
public void start()
public void start(long time)
time
- the starting timepublic long stop()
public void dump(java.util.logging.Logger logger)
logger
- to use for dumppublic long getCount()
public long getCurTime()
public double getAverageTime()
public long getMinTime()
public long getMaxTime()