Created
December 3, 2015 16:09
-
-
Save mkorpela/0e76c48eb6453dc21712 to your computer and use it in GitHub Desktop.
This file contains 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 cProfile | |
import pstats | |
from pabot.pabot import main | |
import os, sys | |
import tempfile | |
profile_results = tempfile.mktemp(suffix='.out', prefix='pybot-profile', dir='.') | |
cProfile.run('main(sys.argv[1:])', profile_results) | |
stats = pstats.Stats(profile_results) | |
stats.sort_stats('cumulative').print_stats(50) | |
os.remove(profile_results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment