summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-07 16:53:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-02-07 16:53:13 (GMT)
commit3e7cc03f63755e2e719fa46aff9b94f648a8f68b (patch)
tree561c2473333d3cd4588eaa680499d01aa66f782b /Lib
parent02384bfa9481d7e6276dfa6cf2fcfb0f59012be2 (diff)
downloadcpython-3e7cc03f63755e2e719fa46aff9b94f648a8f68b.zip
cpython-3e7cc03f63755e2e719fa46aff9b94f648a8f68b.tar.gz
cpython-3e7cc03f63755e2e719fa46aff9b94f648a8f68b.tar.bz2
Issue #20505: add debug info
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/base_events.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index cafd10a..b9de8c7 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.