Name

print_stats

Synopsis

                           s.print_stats(*restrictions)

Outputs statistics about s’s profile data, sorted according to the latest call to s .sort_stats, and subject to the given restrictions, if any, as covered in print_callees. After a few summary lines (date and time on which profile data was collected, number of function calls, and sort criteria used), the output, absent restrictions, is one line per function, with six fields per line, labeled in a header line. For each function f, print_stats outputs six fields:

  1. Total number of calls to function f

  2. Total time spent in function f, exclusive of other functions that f called

  3. Total time per call (i.e., field 2 divided by field 1)

  4. Cumulative time spent in function f, and in all functions directly or indirectly called from f

  5. Cumulative time per call (i.e., field 4 divided by field 1)

  6. The name of function f

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.