summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-11 09:26:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-02-11 09:26:53 (GMT)
commit1db2ba3a92a435e871800612a14a9dfc9e760fab (patch)
tree5244820650c289aa718e2af204356c26c2771b3a /Lib/asyncio
parent5d1ea04b067265918c7a1e2e588e84f8e2ba17f7 (diff)
downloadcpython-1db2ba3a92a435e871800612a14a9dfc9e760fab.zip
cpython-1db2ba3a92a435e871800612a14a9dfc9e760fab.tar.gz
cpython-1db2ba3a92a435e871800612a14a9dfc9e760fab.tar.bz2
Issue #20505: use also the monotonic time to decide if asyncio debug traces
should be printed
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 0200d35..48b3ee3 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -639,15 +639,16 @@ class BaseEventLoop(events.AbstractEventLoop):
event_list = self._selector.select(timeout)
dt = time.perf_counter() - t0
dt_monotonic = time.monotonic() - t0_monotonic
- if not event_list and timeout and dt < timeout:
+ if (not event_list and timeout
+ and (dt < timeout or dt_monotonic < timeout)):
selector = self._selector.__class__.__name__
if (selector.startswith(("Poll", "Epoll", "Iocp"))
or timeout > 1e-3 or dt > 1e-3):
unit, factor = "ms", 1e3
else:
unit, factor = "us", 1e6
- print("asyncio: %s.select(%.3f %s) took %.3f %s"
- " (monotonic: %.3f %s, clock res: %.3f %s)"
+ print("asyncio: %s.select(%.4f %s) took %.3f %s"
+ " (monotonic=%.3f %s, clock res=%.3f %s)"
% (self._selector.__class__.__name__,
timeout * factor, unit,
dt * factor, unit,