From 3e7cc03f63755e2e719fa46aff9b94f648a8f68b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Feb 2014 17:53:13 +0100 Subject: [PATCH] Issue #20505: add debug info --- Lib/asyncio/base_events.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index cafd10a06e1..b9de8c719a8 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -634,7 +634,17 @@ class BaseEventLoop(events.AbstractEventLoop): else: logger.log(level, 'poll took %.3f seconds', t1-t0) else: + t0 = self.time() event_list = self._selector.select(timeout) + dt = self.time() - t0 + if timeout and not event_list and dt < timeout: + print("%s.select(%.3f ms) took %.3f ms (granularity=%.3f ms, resolution=%.3f ms)" + % (self._selector.__class__.__name__, + timeout * 1e3, + dt * 1e3, + self._granularity * 1e3, + self._selector.resolution * 1e3), + file=sys.__stderr__) self._process_events(event_list) # Handle 'later' callbacks that are ready.