… | |
… | |
1619 | |
1619 | |
1620 | =over 4 |
1620 | =over 4 |
1621 | |
1621 | |
1622 | =item ev_periodic_init (ev_periodic *, callback, ev_tstamp at, ev_tstamp interval, reschedule_cb) |
1622 | =item ev_periodic_init (ev_periodic *, callback, ev_tstamp at, ev_tstamp interval, reschedule_cb) |
1623 | |
1623 | |
1624 | =item ev_periodic_set (ev_periodic *, ev_tstamp after, ev_tstamp repeat, reschedule_cb) |
1624 | =item ev_periodic_set (ev_periodic *, ev_tstamp at, ev_tstamp interval, reschedule_cb) |
1625 | |
1625 | |
1626 | Lots of arguments, lets sort it out... There are basically three modes of |
1626 | Lots of arguments, lets sort it out... There are basically three modes of |
1627 | operation, and we will explain them from simplest to most complex: |
1627 | operation, and we will explain them from simplest to most complex: |
1628 | |
1628 | |
1629 | =over 4 |
1629 | =over 4 |
… | |
… | |
1671 | ignored. Instead, each time the periodic watcher gets scheduled, the |
1671 | ignored. Instead, each time the periodic watcher gets scheduled, the |
1672 | reschedule callback will be called with the watcher as first, and the |
1672 | reschedule callback will be called with the watcher as first, and the |
1673 | current time as second argument. |
1673 | current time as second argument. |
1674 | |
1674 | |
1675 | NOTE: I<This callback MUST NOT stop or destroy any periodic watcher, |
1675 | NOTE: I<This callback MUST NOT stop or destroy any periodic watcher, |
1676 | ever, or make ANY event loop modifications whatsoever>. |
1676 | ever, or make ANY other event loop modifications whatsoever>. |
1677 | |
1677 | |
1678 | If you need to stop it, return C<now + 1e30> (or so, fudge fudge) and stop |
1678 | If you need to stop it, return C<now + 1e30> (or so, fudge fudge) and stop |
1679 | it afterwards (e.g. by starting an C<ev_prepare> watcher, which is the |
1679 | it afterwards (e.g. by starting an C<ev_prepare> watcher, which is the |
1680 | only event loop modification you are allowed to do). |
1680 | only event loop modification you are allowed to do). |
1681 | |
1681 | |
… | |
… | |
3229 | function is hiding in (often F<-lrt>). See also C<EV_USE_CLOCK_SYSCALL>. |
3229 | function is hiding in (often F<-lrt>). See also C<EV_USE_CLOCK_SYSCALL>. |
3230 | |
3230 | |
3231 | =item EV_USE_REALTIME |
3231 | =item EV_USE_REALTIME |
3232 | |
3232 | |
3233 | If defined to be C<1>, libev will try to detect the availability of the |
3233 | If defined to be C<1>, libev will try to detect the availability of the |
3234 | real-time clock option at compile time (and assume its availability at |
3234 | real-time clock option at compile time (and assume its availability |
3235 | runtime if successful). Otherwise no use of the real-time clock option will |
3235 | at runtime if successful). Otherwise no use of the real-time clock |
3236 | be attempted. This effectively replaces C<gettimeofday> by C<clock_get |
3236 | option will be attempted. This effectively replaces C<gettimeofday> |
3237 | (CLOCK_REALTIME, ...)> and will not normally affect correctness. See the |
3237 | by C<clock_get (CLOCK_REALTIME, ...)> and will not normally affect |
3238 | note about libraries in the description of C<EV_USE_MONOTONIC>, though. |
3238 | correctness. See the note about libraries in the description of |
|
|
3239 | C<EV_USE_MONOTONIC>, though. Defaults to the opposite value of |
|
|
3240 | C<EV_USE_CLOCK_SYSCALL>. |
3239 | |
3241 | |
3240 | =item EV_USE_CLOCK_SYSCALL |
3242 | =item EV_USE_CLOCK_SYSCALL |
3241 | |
3243 | |
3242 | If defined to be C<1>, libev will try to use a direct syscall instead |
3244 | If defined to be C<1>, libev will try to use a direct syscall instead |
3243 | of calling the system-provided C<clock_gettime> function. This option |
3245 | of calling the system-provided C<clock_gettime> function. This option |