Mercurial > public > mercurial-scm > hg-stable
diff contrib/perf.py @ 30995:22fbca1d11ed
mercurial: switch to util.timer for all interval timings
util.timer is now the best available interval timer, at the expense of not
having a known epoch. Let's use it whenever the epoch is irrelevant.
author | Simon Farnsworth <simonfar@fb.com> |
---|---|
date | Wed, 15 Feb 2017 13:17:39 -0800 |
parents | 74cfc4357c64 |
children | 5a9e4dc8e4fd |
line wrap: on
line diff
--- a/contrib/perf.py Wed Feb 15 11:53:59 2017 -0800 +++ b/contrib/perf.py Wed Feb 15 13:17:39 2017 -0800 @@ -190,13 +190,13 @@ def _timer(fm, func, title=None): results = [] - begin = time.time() + begin = util.timer() count = 0 while True: ostart = os.times() - cstart = time.time() + cstart = util.timer() r = func() - cstop = time.time() + cstop = util.timer() ostop = os.times() count += 1 a, b = ostart, ostop