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)
Timer
public boolean advanceClock(long timeoutMs) throws InterruptedException
advanceClock
in interface Timer
InterruptedException
public int size()
Timer
public void close()
close
in interface AutoCloseable