… | |
… | |
310 | |
310 | |
311 | =item $w = EV::timer $after, $repeat, $callback |
311 | =item $w = EV::timer $after, $repeat, $callback |
312 | |
312 | |
313 | =item $w = EV::timer_ns $after, $repeat, $callback |
313 | =item $w = EV::timer_ns $after, $repeat, $callback |
314 | |
314 | |
315 | Calls the callback after C<$after> seconds. If C<$repeat> is non-zero, |
315 | Calls the callback after C<$after> seconds (which may be fractional). If |
316 | the timer will be restarted (with the $repeat value as $after) after the |
316 | C<$repeat> is non-zero, the timer will be restarted (with the $repeat |
317 | callback returns. |
317 | value as $after) after the callback returns. |
318 | |
318 | |
319 | This means that the callback would be called roughly after C<$after> |
319 | This means that the callback would be called roughly after C<$after> |
320 | seconds, and then every C<$repeat> seconds. The timer does his best not |
320 | seconds, and then every C<$repeat> seconds. The timer does his best not |
321 | to drift, but it will not invoke the timer more often then once per event |
321 | to drift, but it will not invoke the timer more often then once per event |
322 | loop iteration, and might drift in other cases. If that isn't acceptable, |
322 | loop iteration, and might drift in other cases. If that isn't acceptable, |