python 计算程序运行耗时的好用的代码

python 计算程序运行耗时的好用的代码:

import time  
start=time.clock()  
sum=0  
for i in range(50):  
    sum=sum+i   
print(sum)  
end=time.clock()  
print('Runing time= %s Seconds'%(end-start))

 

posted @ 2018-03-02 14:53  彩印网  阅读(294)  评论(0编辑  收藏  举报