(verbose=False)
| 58 | |
| 59 | |
| 60 | def profile(verbose=False): |
| 61 | import pstats |
| 62 | import cProfile |
| 63 | |
| 64 | cProfile.run("timeLRU()", "out.prof") |
| 65 | stats = pstats.Stats("out.prof") |
| 66 | stats.strip_dirs() |
| 67 | stats.sort_stats("time", "calls") |
| 68 | if verbose: |
| 69 | stats.print_stats() |
| 70 | else: |
| 71 | stats.print_stats(20) |
| 72 | |
| 73 | |
| 74 | # profile() |