MCPcopy Index your code
hub / github.com/pythonprofilers/memory_profiler / runctx

Method runctx

memory_profiler.py:765–773  ·  view source on GitHub ↗

Profile a single executable statement in the given namespaces.

(self, cmd, globals, locals)

Source from the content-addressed store, hash-verified

763 return f
764
765 def runctx(self, cmd, globals, locals):
766 """ Profile a single executable statement in the given namespaces.
767 """
768 self.enable_by_count()
769 try:
770 exec(cmd, globals, locals)
771 finally:
772 self.disable_by_count()
773 return self
774
775 def enable_by_count(self):
776 """ Enable the profiler if it hasn't been enabled before.

Callers 1

mprunMethod · 0.95

Calls 2

enable_by_countMethod · 0.95
disable_by_countMethod · 0.95

Tested by

no test coverage detected