Module cProfile
[hide private]
[frames] | no frames]

Module cProfile

Python interface for the 'lsprof' profiler. Compatible with the 'profile' module.

Classes [hide private]
Profile
Profile(custom_timer=None, time_unit=None, subcalls=True, builtins=True)
Functions [hide private]
 
run(statement, filename=None, sort=-1)
Run statement under profiler optionally saving results in filename
 
runctx(statement, globals, locals, filename=None)
Run statement under profiler, supplying your own globals and locals, optionally saving results in filename.
 
help()
 
label(code)
 
main()

Imports: _lsprof


Function Details [hide private]

run(statement, filename=None, sort=-1)

 

Run statement under profiler optionally saving results in filename

This function takes a single argument that can be passed to the "exec" statement, and an optional file name. In all cases this routine attempts to "exec" its first argument and gather profiling statistics from the execution. If no file name is present, then this function automatically prints a simple profiling report, sorted by the standard name string (file/line/function-name) that is presented in each line.

runctx(statement, globals, locals, filename=None)

 

Run statement under profiler, supplying your own globals and locals, optionally saving results in filename.

statement and filename have the same semantics as profile.run