Implement TimerHandle.when() (GH-5473) (GH-5480)
(cherry picked from commit 3d4dbd8f019c0bbac99fc9248077044ff1039ca3)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index bdefcf6..fcca5d4 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -156,6 +156,14 @@
self._loop._timer_handle_cancelled(self)
super().cancel()
+ def when(self):
+ """Return a scheduled callback time.
+
+ The time is an absolute timestamp, using the same time
+ reference as loop.time().
+ """
+ return self._when
+
class AbstractServer:
"""Abstract server returned by create_server()."""