Mercurial > piecrust2
comparison piecrust/environment.py @ 417:eef887cec776
internal: Add utility function for incrementing performance timers.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 20 Jun 2015 23:23:51 -0700 |
parents | ff6cc43fb40c |
children | 3b658190c02b |
comparison
equal
deleted
inserted
replaced
416:ff6cc43fb40c | 417:eef887cec776 |
---|---|
81 self._timers[category] += time.perf_counter() - start | 81 self._timers[category] += time.perf_counter() - start |
82 | 82 |
83 def stepTimer(self, category, value): | 83 def stepTimer(self, category, value): |
84 self._timers[category] += value | 84 self._timers[category] += value |
85 | 85 |
86 def stepTimerSince(self, category, since): | |
87 self.stepTimer(category, time.perf_counter() - since) | |
88 | |
86 def _onSubCacheDirChanged(self, app): | 89 def _onSubCacheDirChanged(self, app): |
87 for name, repo in self.fs_caches.items(): | 90 for name, repo in self.fs_caches.items(): |
88 cache = app.cache.getCache(name) | 91 cache = app.cache.getCache(name) |
89 repo.fs_cache = cache | 92 repo.fs_cache = cache |
90 | 93 |