>>> def timeFun():
... import time
... time_start = time.time() #time.time()为1970.1.1到当前时间的毫秒数
... b, alphas = svmMLiA.smoSimple(dataArr, labelArr, 0.6, 0.001, 40) # 运行主体
... time_end = time.time()
... print time_end - time_start
...
>>> timeFun()
Python计算函数的运行时间
最新推荐文章于 2024-07-26 15:04:30 发布