25.8.1 Profile Objects
Profile objects have the following methods:
-
Add an arbitrary labelled value to the profile output.
-
Close the logfile and terminate the profiler.
-
Return the file descriptor of the profiler's log file.
-
Profile an exec-compatible string in the script environment.
The globals from the __main__ module are used as
both the globals and locals for the script.
runcall( |
func, *args, **keywords) |
-
Profile a single call of a callable.
Additional positional and keyword arguments may be passed
along; the result of the call is returned, and exceptions are
allowed to propagate cleanly, while ensuring that profiling is
disabled on the way out.
runctx( |
cmd, globals, locals) |
-
Evaluate an exec-compatible string in a specific environment.
The string is compiled before profiling begins.
-
Start the profiler.
-
Stop the profiler.
Release 2.5.4, documentation updated on 23rd December, 2008.
See About this document... for information on suggesting changes.