Mercurial > hg
diff contrib/hgperf @ 30975: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 | 377a111d1cd2 |
children | 78f644fdaa2a |
line wrap: on
line diff
--- a/contrib/hgperf Wed Feb 15 11:53:59 2017 -0800 +++ b/contrib/hgperf Wed Feb 15 13:17:39 2017 -0800 @@ -55,17 +55,15 @@ import mercurial.util import mercurial.dispatch -import time - def timer(func, title=None): results = [] - begin = time.time() + begin = mercurial.util.timer() count = 0 while True: ostart = os.times() - cstart = time.time() + cstart = mercurial.util.timer() r = func() - cstop = time.time() + cstop = mercurial.util.timer() ostop = os.times() count += 1 a, b = ostart, ostop