Mercurial > public > mercurial-scm > hg-stable
diff mercurial/branchmap.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 | 3dbc95f3eb31 |
children | 2a18e9e6ca43 |
line wrap: on
line diff
--- a/mercurial/branchmap.py Wed Feb 15 11:53:59 2017 -0800 +++ b/mercurial/branchmap.py Wed Feb 15 13:17:39 2017 -0800 @@ -9,7 +9,6 @@ import array import struct -import time from .node import ( bin, @@ -21,6 +20,7 @@ encoding, error, scmutil, + util, ) array = array.array @@ -261,7 +261,7 @@ missing heads, and a generator of nodes that are strictly a superset of heads missing, this function updates self to be correct. """ - starttime = time.time() + starttime = util.timer() cl = repo.changelog # collect new branch entries newbranches = {} @@ -314,7 +314,7 @@ self.tiprev = tiprev self.filteredhash = scmutil.filteredhash(repo, self.tiprev) - duration = time.time() - starttime + duration = util.timer() - starttime repo.ui.log('branchcache', 'updated %s branch cache in %.4f seconds\n', repo.filtername, duration)