MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / end

Method end

src/13/making_a_stopwatch/stopwatch.py:14–19  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12 self._start = self._func()
13
14 def end(self):
15 if self._start is None:
16 raise RuntimeError('Not started')
17 end = self._func()
18 self.elapsed += end - self._start
19 self._start = None
20
21 def reset(self):
22 self.elapsed = 0.0

Callers 2

__exit__Method · 0.95
stopwatch.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected