public class Timer extends Object
Modifier and Type | Method and Description |
---|---|
void |
schedule(@NotNull Runnable eventHandler,
long initialDelayMs) |
void |
scheduleAtFixedRate(@NotNull VanillaEventHandler eventHandler,
long initialDelayMs,
long periodMs)
uses the event loop thread to call the event handler periodically, the time that the event is
called back is best efforts, but if the thread is busy that call back maybe delayed
|
void |
scheduleAtFixedRate(@NotNull VanillaEventHandler eventHandler,
long initialDelayMs,
long periodMs,
HandlerPriority priority) |
public Timer(@NotNull @NotNull EventLoop eventLoop)
eventLoop
- the event loop that the timer task is run onpublic void scheduleAtFixedRate(@NotNull @NotNull VanillaEventHandler eventHandler, long initialDelayMs, long periodMs)
eventHandler
- the handler to be called backinitialDelayMs
- how long in milliseconds to wait before being called backperiodMs
- the poll interval of being calledpublic void scheduleAtFixedRate(@NotNull @NotNull VanillaEventHandler eventHandler, long initialDelayMs, long periodMs, HandlerPriority priority)
public void schedule(@NotNull @NotNull Runnable eventHandler, long initialDelayMs)
Copyright © 2022. All rights reserved.