```{index} single: timer (EV) ``` ```{index} single: EV::timer ``` ```{index} single: EV::timer_ns ``` # timer Call the callback after a number of seconds, and optionally again and again after that. Also available as `EV::timer_ns`. ## Synopsis ```perl my $once = EV::timer 2.5, 0, sub { ... }; # in 2.5 seconds, once my $every = EV::timer 0, 60, sub { ... }; # now, then every minute my $later = EV::timer_ns 10, 0, sub { ... }; # created stopped ``` ## What you get back An `EV::Timer` watcher. The callback gets the watcher and `EV::TIMER`. ## Edge cases - Times count from the loop's time, `EV::now`, on a clock that system clock changes do not move; a timer for "at this wall-clock time" is `EV::periodic`. - A repeating timer is restarted with the repeat interval after its callback; it fires at most once per loop iteration and may drift. - A negative repeat croaks `repeat value must be >= 0`. ## Differences from upstream Fully compatible with upstream. Covered by `t/81-xs-native/EV/110-upstream-01_timer.t`. ## See also - `EV::Timer` - `again`, `remaining` and the repeat interval - `EV::periodic` - timers on wall-clock time