cProfile.Profile

class cProfile.Profile[source]

Builds a profiler object using the specified timer function. The default timer is a fast built-in one based on real time. For custom timer functions returning integers, time_unit can be a float specifying a scale (i.e. how long each integer unit is, in seconds).

Methods

__format__ default object formatter
__new__((S, ...)
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__sizeof__(() -> int) size of object in memory, in bytes
__subclasshook__ Abstract classes can override this to customize issubclass().
clear() Clear all profiling information collected so far.
create_stats()
disable() Stop collecting profiling information.
dump_stats(file)
enable([subcalls, builtins]) Start collecting profiling information.
getstats(() -> list of profiler_entry objects) Return all information collected by the profiler.
print_stats([sort])
run(cmd)
runcall(func, *args, **kw)
runctx(cmd, globals, locals)
snapshot_stats()