aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-17 09:36:36 +0100
committerGitHub <noreply@github.com>2018-12-17 09:36:36 +0100
commit2cf4c202ffeb30787c944365ba54013688b854c2 (patch)
treeaa98e69de819cb1cd0f5bd25fb10636f98001ff2 /Lib/pydoc.py
parentbpo-35186: Remove "built with" comment in setup.py upload (GH-10414) (diff)
downloadcpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.gz
cpython-2cf4c202ffeb30787c944365ba54013688b854c2.tar.bz2
cpython-2cf4c202ffeb30787c944365ba54013688b854c2.zip
bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)
Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds).
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r--Lib/pydoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 54e6ce8b25b..1d84b847cf9 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -2231,14 +2231,14 @@ def _start_server(urlhandler, hostname, port):
Let the server do its thing. We just need to monitor its status.
Use time.sleep so the loop doesn't hog the CPU.
- >>> starttime = time.time()
+ >>> starttime = time.monotonic()
>>> timeout = 1 #seconds
This is a short timeout for testing purposes.
>>> while serverthread.serving:
... time.sleep(.01)
- ... if serverthread.serving and time.time() - starttime > timeout:
+ ... if serverthread.serving and time.monotonic() - starttime > timeout:
... serverthread.stop()
... break