summaryrefslogtreecommitdiff
path: root/ev.pod
diff options
context:
space:
mode:
authorroot <root>2008-09-08 16:36:14 +0000
committerroot <root>2008-09-08 16:36:14 +0000
commita940c598f3ecbfb8b20cd9b568c87f74995e07c8 (patch)
tree055cb5dfa13003a00eb2d5c37219ae8a6f046528 /ev.pod
parentba391642382f38a4f8693492b5d7f2f963a39844 (diff)
*** empty log message ***
Diffstat (limited to 'ev.pod')
-rw-r--r--ev.pod19
1 files changed, 13 insertions, 6 deletions
diff --git a/ev.pod b/ev.pod
index 0044dff..b27ab0d 100644
--- a/ev.pod
+++ b/ev.pod
@@ -1199,18 +1199,25 @@ year, it will still time out after (roughly) and hour. "Roughly" because
detecting time jumps is hard, and some inaccuracies are unavoidable (the
monotonic clock option helps a lot here).
+The callback is guaranteed to be invoked only after its timeout has passed,
+but if multiple timers become ready during the same loop iteration then
+order of execution is undefined.
+
+=head3 The special problem of time updates
+
+Requesting the current time is a costly operation (it usually takes at
+least two syscalls): EV therefore updates it's idea of the current time
+only before and after C<ev_loop> polls for new events, which causes the
+difference between C<ev_now ()> and C<ev_time ()>.
+
The relative timeouts are calculated relative to the C<ev_now ()>
time. This is usually the right thing as this timestamp refers to the time
of the event triggering whatever timeout you are modifying/starting. If
-you suspect event processing to be delayed and you I<need> to base the timeout
-on the current time, use something like this to adjust for this:
+you suspect event processing to be delayed and you I<need> to base the
+timeout on the current time, use something like this to adjust for this:
ev_timer_set (&timer, after + ev_now () - ev_time (), 0.);
-The callback is guaranteed to be invoked only after its timeout has passed,
-but if multiple timers become ready during the same loop iteration then
-order of execution is undefined.
-
=head3 Watcher-Specific Functions and Data Members
=over 4