Revision 9523
Added by Aaron Marcuse-Kubitza over 11 years ago
profiling.py | ||
---|---|---|
11 | 11 |
self.total = datetime.timedelta() |
12 | 12 |
if start_now: self.start() |
13 | 13 |
|
14 |
def add_time(self, time): self.total += time |
|
15 |
|
|
14 | 16 |
def start(self): self.start_ = dates.now() |
15 | 17 |
|
16 | 18 |
def stop(self): |
17 | 19 |
assert self.start_ != None |
18 |
self.total += dates.now() - self.start_
|
|
20 |
self.add_time(dates.now() - self.start_)
|
|
19 | 21 |
|
20 | 22 |
def msg(self): return 'Took '+str(self.total)+' sec' |
21 | 23 |
|
Also available in: Unified diff
lib/profiling.py: Profiler: added add_time() and use it instead of `self.total +=`