public class Timing
extends java.lang.Object
Timer to wait for a fixed amount of time.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
forcePass |
protected long |
time |
| Constructor and Description |
|---|
Timing() |
| Modifier and Type | Method and Description |
|---|---|
void |
forcePass()
Force the time to have passed.
|
long |
getPassedTime() |
long |
getTime() |
boolean |
hasPassed(long time)
Check if a certain amount of time has passed.
|
void |
reset()
Reset the time.
|
long |
timeUntil(long time)
Get the time until a certain amount of time has passed.
|
void |
waitUntil(long time)
Wait until a certain amount of time has passed.
|
public long getTime()
public void reset()
public void forcePass()
public long getPassedTime()
public boolean hasPassed(long time)
time - The time to check forpublic long timeUntil(long time)
time - The time to check forpublic void waitUntil(long time)
throws java.lang.InterruptedException
time - The time to check forjava.lang.InterruptedException - If the thread is interrupted