Created
July 30, 2015 15:16
-
-
Save thelahunginjeet/4087a64b9f28d3af3fe1 to your computer and use it in GitHub Desktop.
example usage of cProfile module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pstats,cProfile | |
import my_function | |
cProfile.runctx("my_function(a,b)",globals(),locals(),"Profile.prof") | |
s = pstats.Stats("Profile.prof") | |
s.strip_dirs().sort_stats("time").print_stats() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment