cProfile——Python性能分析工具

Python自帶了幾個性能分析的模塊:profile、cProfile和hotshot,使用方法基本都差不多,無非模塊是純Python還是用C寫的。本文介紹cProfile。  例子 import time def func1(): sum = 0 for i in range(1000000): sum += i def func2(): time.sle
相關文章
相關標籤/搜索