@@ -205,7 +205,7 @@ def tic(self, msg=_NotSpecified,
205
205
class was constructed). Note: timing logged using logger.info
206
206
207
207
"""
208
- self ._lastTime = default_timer ()
208
+ self ._lastTime = self . _loadTime = default_timer ()
209
209
if msg is _NotSpecified :
210
210
msg = "Resetting the tic/toc delta timer"
211
211
if msg is not None :
@@ -225,9 +225,9 @@ def toc(self, msg=_NotSpecified, delta=True,
225
225
called this method; if msg is None, then no message is
226
226
printed.
227
227
delta (bool): print out the elapsed wall clock time since
228
- the last call to :meth:`tic` or :meth:`toc`
229
- (``True`` (default)) or since the module was first
230
- loaded (``False`` ).
228
+ the last call to :meth:`tic` (``False``) or since the
229
+ most recent call to either :meth:`tic` or :meth:`toc`
230
+ (``True`` (default) ).
231
231
ostream (FILE): an optional output stream (overrides the ostream
232
232
provided when the class was constructed).
233
233
logger (Logger): an optional output stream using the python
@@ -254,6 +254,9 @@ class was constructed). Note: timing logged using logger.info
254
254
msg = "[+%7.2f] %s\n " % (ans , msg )
255
255
else :
256
256
ans = now - self ._loadTime
257
+ # Even though we are reporting the cumulative time, we will
258
+ # still reset the delta timer.
259
+ self ._lastTime = now
257
260
if msg is not None :
258
261
msg = "[%8.2f] %s\n " % (ans , msg )
259
262
0 commit comments