Yury Selivanov added the comment:
So here's the relevant piece of code:
end_time = self.time() + self._clock_resolution
while self._scheduled:
handle = self._scheduled[0]
if handle._when >= end_time:
break
handle = heapq.heappop(self._scheduled)
handle._scheduled = False
self._ready.append(handle)
As I see it, currently we peek into the future time. Why don't we do
end_time = self.time() - self._clock_resolution
to guarantee that timeouts will always be triggered *after* the requested time,
not before? I don't see how the performance can become worse if we do this.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31539>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com