PyDocs

Nav

Debugging and profiling

Profile

  • Profile(timer=None, timeunit=0.0, subcalls=True, builtins=True)
Profile(timer=None, timeunit=None, subcalls=True, builtins=True)

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, timeunit can
be a float specifying a scale (i.e. how long each integer unit
is, in seconds).
Changed in 3.8
  • 3.8: Added context manager support.
Members of Profile

c

create_stats
Stop collecting data and record the results internally as the current profile.

d

disable
Stop collecting profiling information.
dump_stats
Write the current profile data to filename.

e

enable
Start collecting profiling information.

p

print_stats
Create a pstats.Stats object from the current profile and print the results to standard output.

r

run
Profile the command string via exec().
runcall
Profile a function call.
runctx
Profile the command string via exec() with the specified namespaces.
0 Examples
No examples for profiling.tracing/Profile.
See Also
No see-alsos for profiling.tracing/Profile
0 Notes
No notes for Profile