Skip to content

Instantly share code, notes, and snippets.

@thelahunginjeet
Created July 30, 2015 15:16
Show Gist options
  • Save thelahunginjeet/4087a64b9f28d3af3fe1 to your computer and use it in GitHub Desktop.
Save thelahunginjeet/4087a64b9f28d3af3fe1 to your computer and use it in GitHub Desktop.
example usage of cProfile module
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