public class Timer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
running |
private long |
startTime |
private long |
stopTime |
Constructor and Description |
---|
Timer()
Construct a new timer that starts immediatly.
|
Modifier and Type | Method and Description |
---|---|
long |
diff()
Return the number of milliseconds the timer has been running.
|
void |
start()
Start the timer.
|
void |
stop()
Stop the timer.
|
java.lang.String |
toString()
Return a string representation of the timer.
|
private long startTime
private long stopTime
private boolean running
public void start()
public void stop()
public long diff()
public java.lang.String toString()
toString
in class java.lang.Object
diff()