Created
August 16, 2011 20:19
-
-
Save lambacck/1150065 to your computer and use it in GitHub Desktop.
Don't need to call the run method
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
from cProfile import Profile | |
profiler = Profile() | |
def write_chains(): | |
chain_count = 0 | |
for chain in chains: | |
chain_count += 1 | |
print chain_count | |
if chain_count == 2305838: | |
profiler.enable() | |
try: | |
write_chains() | |
except KeyboardInterrupt: | |
profiler.dump_stats('prof_output2') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Of course I think this excludes write_chains from the call tree collected from cProfile.