Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """Example usage for cprofile
- pip install gprof2dot
- """
- import cProfile
- import pstats
- import StringIO
- pr = cProfile.Profile()
- # start profiling
- pr.enable()
- # end profiling
- pr.disable()
- s = StringIO.StringIO()
- sortby = 'cumulative'
- ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
- ps.print_stats()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement