Name
sort_stats
Synopsis
s
.sort_stats(key
, *keys
)
Gives one or more keys (primary first, if more than one) on which to
sort future output. Each key is a string. The sort is descending for
keys indicating times or numbers, alphabetical (ascending) for key
'nfl
‘. The most frequently used keys when calling
sort_stats
are:
- '
calls
' Number of calls to the function (like field
1
covered inprint_stats
)- '
cumulative
' Cumulative time spent in the function and all functions it called (like field
4
i covered inprint_stats
)- '
nfl
' Name of the function, its module, line number of the function in its file (like field
6
covered inprint_stats
)- '
time
' Total time spent in the function itself, exclusive of functions it called (like field
2
covered inprint_stats
)
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.