您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何在python中计算程序运行时间?

如何在python中计算程序运行时间?

您可能需要看一下该timeit模块:

http://docs.python.org/library/timeit.html

profile模块:

http://docs.python.org/library/profile.html

这里还有一些不错的教程:

http://www.doughellmann.com/PyMOTW/profile/index.html

http://www.doughellmann.com/PyMOTW/timeit/index.html

而且该time模块也可能派上用场,尽管我更喜欢后两项关于基准测试和性能分析代码性能的建议:

http://docs.python.org/library/time.html

python 2022/1/1 18:38:56 有235人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶