public class Timer
extends java.lang.Object
Constructor and Description |
---|
Timer(long length)
Create a timer and set it to the number of milliseconds provided.
|
Modifier and Type | Method and Description |
---|---|
long |
getTimePassed()
Calculate how long the timer was running.
|
boolean |
isTimeOut()
Calculate if the timer has ran the amount of time it was set to run.
|
void |
pause()
Pause the timer.
|
void |
restart()
Restart the timer.
|
void |
resume()
Resume the timer.
|
void |
setTo(long length)
Set the number of milliseconds the timer should run starting from now.
|
public Timer(long length)
length
- the number of millisecond the timer should be set forpublic long getTimePassed()
public boolean isTimeOut()
public void pause()
public void resume()
public void restart()
public void setTo(long length)
length
- the number of millisecond the timer should be set for