经过长时间的函数调用(16个小时)后,我以KeyboardInterrupt提前结束了它,但是偶然地也中断了cProfile,因为响应时间太长了。在Debug Stackviewer中,我遇到了这个问题:
- KeyboardInterrupt:
- idlelib.run.runcode(...)
- __主__。<模块>(...)
- cProfile.run(...)
- profile.run(...)
- profile._show(...)
- cProfile.print_stats(...)
- importlib._bootstrap._find_and_load(...)
- importlib._bootstrap._find_and_load_unlocked(...)
- importlib._bootstrap.find_spec(...)
- importlib._bootstrap._get_spec(...)
- importlib._bootstrap.find_spec(...)
- importlib._bootstrap._path_stat(...)
有没有办法恢复cProfile要打印的内容,并且有一种方法可以更聪明地将cProfile用于过长的函数调用。