Stop the timer.
Stop the timer. Pending tasks are cancelled. The timer is unusable after being stopped.
Performs an operation at the specified time.
Performs an operation at the specified time. Interrupting the Future will cancel the scheduled timer task, if not too late.
Performs an operation after the specified delay.
Performs an operation after the specified delay. Interrupting the Future will cancel the scheduled timer task, if not too late.
Run f
every elapsed period
, starting period
from now.
Run f
at time when
; subsequently run f
at every
elapsed period
.
Run f
at time when
.
Timers are used to schedule tasks in the future. They support both one-shot and recurring tasks.
Timers propagate Local state, including the Monitor, from when the task is scheduled to when it is run.
Scheduling tasks with Timers should rarely be done directly; for example, when programming with Futures, prefer using Future.sleep.