Run f
at time when
; subsequently run f
at every
elapsed period
.
Run f
at time when
.
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 immediately.
Timers are used to schedule tasks in the future. They support both one-shot and recurring tasks.
Scheduling tasks with Timers should rarely be done directly; for example, when programming with Futures, prefer using Future$.sleep.