| 114 | | import hotshot, hotshot.stats |
|---|
| 115 | | prof = hotshot.Profile('gaphor.prof') |
|---|
| 116 | | prof.runcall(starter) |
|---|
| 117 | | prof.close() |
|---|
| 118 | | stats = hotshot.stats.load('gaphor.prof') |
|---|
| 119 | | stats.strip_dirs() |
|---|
| 120 | | stats.sort_stats('time', 'calls') |
|---|
| 121 | | stats.print_stats(20) |
|---|
| | 114 | try: |
|---|
| | 115 | import cProfile |
|---|
| | 116 | import pstats |
|---|
| | 117 | prof = cProfile.Profile() |
|---|
| | 118 | prof.runcall(starter) |
|---|
| | 119 | prof.dump_stats('gaphor.prof') |
|---|
| | 120 | p = pstats.Stats('gaphor.prof') |
|---|
| | 121 | p.strip_dirs().sort_stats('time').print_stats(20) |
|---|
| | 122 | except ImportError, ex: |
|---|
| | 123 | import hotshot, hotshot.stats |
|---|
| | 124 | prof = hotshot.Profile('gaphor.prof') |
|---|
| | 125 | prof.runcall(starter) |
|---|
| | 126 | prof.close() |
|---|
| | 127 | stats = hotshot.stats.load('gaphor.prof') |
|---|
| | 128 | stats.strip_dirs() |
|---|
| | 129 | stats.sort_stats('time', 'calls') |
|---|
| | 130 | stats.print_stats(20) |
|---|