Project

General

Profile

1
#!/usr/bin/env python
2
# Analyzes a profiling statistics file
3

    
4
import pstats
5
import sys
6

    
7
def main():
8
    try: _prog_name, stats_path = sys.argv
9
    except ValueError:
10
        raise SystemExit('Usage: '+sys.argv[0]+' stats_file')
11
    
12
    stats = pstats.Stats(stats_path)
13
    stats.strip_dirs()
14
    stats.sort_stats('cumulative')
15
    stats.print_stats()
16

    
17
main()
(15-15/23)