diff -r eaae4008327d Lib/asyncio/base_events.py --- a/Lib/asyncio/base_events.py Tue Feb 04 09:49:14 2014 +0100 +++ b/Lib/asyncio/base_events.py Tue Feb 04 10:21:46 2014 +0100 @@ -618,6 +618,7 @@ class BaseEventLoop(events.AbstractEvent timeout = deadline else: timeout = min(timeout, deadline) + timeout += self._granularity # TODO: Instrumentation only in debug mode? if logger.isEnabledFor(logging.INFO): @@ -638,7 +639,7 @@ class BaseEventLoop(events.AbstractEvent self._process_events(event_list) # Handle 'later' callbacks that are ready. - now = self.time() + self._granularity + now = self.time() while self._scheduled: handle = self._scheduled[0] if handle._when > now: diff -r eaae4008327d Lib/selectors.py --- a/Lib/selectors.py Tue Feb 04 09:49:14 2014 +0100 +++ b/Lib/selectors.py Tue Feb 04 10:21:46 2014 +0100 @@ -370,9 +370,7 @@ if hasattr(select, 'poll'): elif timeout <= 0: timeout = 0 else: - # poll() has a resolution of 1 millisecond, round away from - # zero to wait *at least* timeout seconds. - timeout = math.ceil(timeout * 1e3) + timeout = timeout * 1e3 ready = [] try: fd_event_list = self._poll.poll(timeout) @@ -432,10 +430,6 @@ if hasattr(select, 'epoll'): timeout = -1 elif timeout <= 0: timeout = 0 - else: - # epoll_wait() has a resolution of 1 millisecond, round away - # from zero to wait *at least* timeout seconds. - timeout = math.ceil(timeout * 1e3) * 1e-3 max_ev = len(self._fd_to_key) ready = [] try: diff -r eaae4008327d Modules/selectmodule.c --- a/Modules/selectmodule.c Tue Feb 04 09:49:14 2014 +0100 +++ b/Modules/selectmodule.c Tue Feb 04 10:21:46 2014 +0100 @@ -1460,7 +1460,7 @@ pyepoll_poll(pyEpoll_Object *self, PyObj else { /* epoll_wait() has a resolution of 1 millisecond, round away from zero to wait *at least* dtimeout seconds. */ - timeout = (int)ceil(dtimeout * 1000.0); + timeout = (int)(dtimeout * 1000.0); } if (maxevents == -1) {