MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / tok

Method tok

python/pymesh/timethis.py:36–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

34 raise RuntimeError("Overwriting previous tik for '{}'".format(f_name))
35
36 def tok(self):
37 finish = time()
38 f_name = self.__get_name()
39 start = self.tiks.pop(f_name, None)
40 if start is None:
41 raise RuntimeError("No tik before tok for '{}'".format(f_name))
42
43 duration = finish - start
44 self.hist[f_name] = self.hist.get(f_name, 0) + duration
45 self.count[f_name] = self.count.get(f_name, 0) + 1
46 return duration
47
48 def __get_name(self):
49 func_name = self.f.__name__

Callers 2

__call__Method · 0.95
tokMethod · 0.45

Calls 4

__get_nameMethod · 0.95
RuntimeErrorClass · 0.85
popMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected