| Modifier and Type | Field and Description |
|---|---|
protected long |
delay |
protected boolean |
forcePass |
protected long |
time |
| Constructor and Description |
|---|
Timer(long delay) |
| Modifier and Type | Method and Description |
|---|---|
void |
forcePass()
Force the timer to tick.
|
long |
getDelay() |
long |
getPassedTime() |
long |
getTime() |
boolean |
hasPassed()
Check if the delay has passed.
|
void |
reset()
Reset the time.
|
long |
timeUntil() |
long |
waitUntil()
Wait until the delay has passed.
|
protected final long delay
protected long time
protected boolean forcePass
public long getDelay()
public long getTime()
public void reset()
public void forcePass()
public long getPassedTime()
public boolean hasPassed()
public long timeUntil()
public long waitUntil()
throws java.lang.InterruptedException
forcePass() has been called.java.lang.InterruptedException - If the thread is interrupted