changeset 44017:6b90f5c89cb4

py3: replace `time.clock()` with `time.perf_counter()` The former was removed in 3.8. The util function uses `time.clock()` if the latter is unavailable. Differential Revision: https://phab.mercurial-scm.org/D7779
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 30 Dec 2019 23:53:53 -0500
parents 1e0783b946c8
children f9d29e1d3354
files mercurial/dispatch.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed Jan 08 09:59:34 2020 -0800
+++ b/mercurial/dispatch.py	Mon Dec 30 23:53:53 2019 -0500
@@ -15,7 +15,6 @@
 import re
 import signal
 import sys
-import time
 import traceback
 
 
@@ -1040,8 +1039,8 @@
             def get_times():
                 t = os.times()
                 if t[4] == 0.0:
-                    # Windows leaves this as zero, so use time.clock()
-                    t = (t[0], t[1], t[2], t[3], time.clock())
+                    # Windows leaves this as zero, so use time.perf_counter()
+                    t = (t[0], t[1], t[2], t[3], util.timer())
                 return t
 
             s = get_times()