ncalls tottime percall cumtime percall filename:lineno(function : ( mymodule py: (function_b mymodule py: ( {built-in method bisect_left {built-in method exec {built-in method len {built-in method sorted function calls in cpu seconds ncalls tottime percall cumtime percall filename:lineno(function : ( mymodule py: (function_c mymodule py: ( {built-in method execthe ncalls ("number of calls"column lists the number of calls to the specified function (listed in the filename:lineno(functioncolumnrecall that we repeated the calls timesso we must keep this in mind the tottime ("total time"column lists the total time spent in the functionbut excluding time spent inside functions called by the function the first percall column lists the average time of each call to the function (tottime /ncallsthe cumtime ("cumulative time"column lists the time spent in the function and includes the time spent inside functions called by the function the second percall column lists the average time of each call to the functionincluding functions called by it this output is far more enlightening than the timeit module' raw timings we can immediately see that both function_b(and function_c(use generators that are called more than timesmaking them both at least ten times slower than function_a(furthermorefunction_b(calls more functions generallyincluding call to the built-in sorted(functionand this makes it almost twice as slow as function_c(of coursethe timeit(module gave us sufficient information to see these differences in timingbut the cprofile module allows us to see the details of why the differences are there in the first place just as the timeit module allows us to time code without instrumenting itso does the cprofile module howeverwhen using the cprofile module from the command line we cannot specify exactly what we want executed--it simply executes the given program or module and reports the timings of everything the command line to use is python - cprofile programormodule pyand the output produced is in the same format as we saw earlierhere is an extract slightly reformatted and with most lines omitted