

Select profile.pstat and now you can view and sort by different headings as desired. You now have a profile file that you would like to examine. Now, call pr.dump_stats('profile.pstat') OS - Any latest 64-bit version of macOS/Microsoft Windows/Linux. Join this free Spoken English course to upgrade your communication skills, pronunciation, vocabulary, and professional communication. P圜harm: the Python IDE for Professional Developers by JetBrains P圜harm The Python IDE for Professional Developers Download Full-fledged Professional or Free Community Why P圜harm All the Python tools in one place Be More Productive Save time while P圜harm takes care of the routine.In the inner section of your code, do your profiling.In an outer section of your code, instantiate Profile.To make that useful though, you'll want to save this to a file. Indeed, do as suggested by instantiating Profile and enabling and disabling as needed.

This also works better for web applications or larger applications versus simple command line programs where printing the output to stdout might be okay (still better to be able to sort different ways through P圜harm's viewer). If using 3.x (don't know about 2.x), I'll add to shafeen's answer and make it more P圜harm specific as per the original post. Note: As mentioned in the comments, the following applies to the paid version of P圜harm:
