apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@clove.org>
Subject [PATCH] possible optimization in apr_poll()?
Date Mon, 15 Jul 2002 03:48:29 GMT
Is this at all portable? I'm making the approximation that n>>10 is
about the same as a /1000, and since apr_poll() isn't guaranteed to be
that accurate, this should be a good chance for an optimization, right?

-aaron


Index: srclib/apr/poll/unix/poll.c
===================================================================
RCS file: /home/cvs/apr/poll/unix/poll.c,v
retrieving revision 1.6
diff -u -r1.6 poll.c
--- srclib/apr/poll/unix/poll.c	13 Jul 2002 06:31:52 -0000	1.6
+++ srclib/apr/poll/unix/poll.c	15 Jul 2002 03:46:25 -0000
@@ -128,7 +128,7 @@
     }
 
     if (timeout > 0) {
-        timeout /= 1000; /* convert microseconds to milliseconds */
+        timeout >>= 10; /* approximate "/= 1000" to convert to milliseconds */
     }
 
     i = poll(pollset, num, timeout);

Mime
View raw message