Patchwork D7779: py3: replace `time.clock()` with `time.perf_counter()`

login
register
mail settings
Submitter phabricator
Date Dec. 31, 2019, 9:58 p.m.
Message ID <differential-rev-PHID-DREV-yxaduvbeowlc7liqcjr4-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44138/
State Superseded
Headers show

Comments

phabricator - Dec. 31, 2019, 9:58 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The former was removed in 3.8.  The util function uses `time.clock()` if the
  latter is unavailable.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7779

AFFECTED FILES
  mercurial/dispatch.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -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()