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
相关文章
相关标签/搜索