ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.174 by root, Mon Aug 18 23:23:45 2008 UTC vs.
Revision 1.175 by root, Mon Sep 8 16:36:14 2008 UTC

1197times out after an hour and you reset your system clock to January last 1197times out after an hour and you reset your system clock to January last
1198year, it will still time out after (roughly) and hour. "Roughly" because 1198year, it will still time out after (roughly) and hour. "Roughly" because
1199detecting time jumps is hard, and some inaccuracies are unavoidable (the 1199detecting time jumps is hard, and some inaccuracies are unavoidable (the
1200monotonic clock option helps a lot here). 1200monotonic clock option helps a lot here).
1201 1201
1202The callback is guaranteed to be invoked only after its timeout has passed,
1203but if multiple timers become ready during the same loop iteration then
1204order of execution is undefined.
1205
1206=head3 The special problem of time updates
1207
1208Requesting the current time is a costly operation (it usually takes at
1209least two syscalls): EV therefore updates it's idea of the current time
1210only before and after C<ev_loop> polls for new events, which causes the
1211difference between C<ev_now ()> and C<ev_time ()>.
1212
1202The relative timeouts are calculated relative to the C<ev_now ()> 1213The relative timeouts are calculated relative to the C<ev_now ()>
1203time. This is usually the right thing as this timestamp refers to the time 1214time. This is usually the right thing as this timestamp refers to the time
1204of the event triggering whatever timeout you are modifying/starting. If 1215of the event triggering whatever timeout you are modifying/starting. If
1205you suspect event processing to be delayed and you I<need> to base the timeout 1216you suspect event processing to be delayed and you I<need> to base the
1206on the current time, use something like this to adjust for this: 1217timeout on the current time, use something like this to adjust for this:
1207 1218
1208 ev_timer_set (&timer, after + ev_now () - ev_time (), 0.); 1219 ev_timer_set (&timer, after + ev_now () - ev_time (), 0.);
1209
1210The callback is guaranteed to be invoked only after its timeout has passed,
1211but if multiple timers become ready during the same loop iteration then
1212order of execution is undefined.
1213 1220
1214=head3 Watcher-Specific Functions and Data Members 1221=head3 Watcher-Specific Functions and Data Members
1215 1222
1216=over 4 1223=over 4
1217 1224

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines