public class Timer extends Object
Modifier and Type | Method and Description |
---|---|
void |
schedule(Runnable eventHandler,
long initialDelayMs) |
void |
scheduleAtFixedRate(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
|
public Timer(@NotNull EventLoop eventLoop)
eventLoop
- the event loop that the timer task is run onpublic void scheduleAtFixedRate(@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 schedule(@NotNull Runnable eventHandler, long initialDelayMs)
Copyright © 2020. All rights reserved.