python 计算代码运行所花时间 timeit

import timeit

timeit.timeit('time.sleep(1)',number=2)
> 2.001138338268717

猜你喜欢

转载自www.cnblogs.com/wanderingfish/p/11526814.html
今日推荐