February 2006
Intermediate to advanced
648 pages
14h 53m
English
The profile module is used to collect profiling information.
run(command [, filename ])
Executes the contents of command using the exec statement under the profiler. filename is the name of a file in which raw profiling data is saved. If it’s omitted, a report such as the following is printed to standard output:
126 function calls (6 primitive calls) in 5.130 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.030 0.030 5.070 5.070 <string>:1(?)
121/1 5.020 0.041 5.020 5.020 book.py:11(process)
1 0.020 0.020 5.040 5.040 book.py:5(?)
2 0.000 0.000 0.000 0.000 exceptions.py:101(__init__)
1 0.060 0.060 5.130 5.130 profile:0(execfile('book.py'))
0 0.000 0.000 profile:0(profiler)