public class SystemTimer extends Object implements Timer
| Constructor and Description |
|---|
SystemTimer(String executorName) |
SystemTimer(String executorName,
long tickMs,
int wheelSize,
long startMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TimerTask timerTask)
Add a new task to this executor.
|
boolean |
advanceClock(long timeoutMs)
Advances the clock if there is an expired bucket.
|
void |
close() |
int |
size()
Get the number of tasks pending execution
|
public SystemTimer(String executorName)
public SystemTimer(String executorName, long tickMs, int wheelSize, long startMs)
public void add(TimerTask timerTask)
Timerpublic boolean advanceClock(long timeoutMs)
throws InterruptedException
advanceClock in interface TimerInterruptedExceptionpublic int size()
Timerpublic void close()
close in interface AutoCloseable