public interface Timer extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
add(TimerTask timerTask)
Add a new task to this executor.
|
boolean |
advanceClock(long timeoutMs)
Advance the internal clock, executing any tasks whose expiration has been
reached within the duration of the passed timeout.
|
int |
size()
Get the number of tasks pending execution
|
closevoid add(TimerTask timerTask)
timerTask - the task to addboolean advanceClock(long timeoutMs)
throws InterruptedException
timeoutMs - InterruptedExceptionint size()