我如何获得执行Python程序的时间?
问题: I have a command line program in Python that takes a while to finish. 我在Python中有一个命令行程序,需要花一些时间才能完成。 I want to know the exact time it takes to finish running. 我想知道完成跑步所需的确切时间。 I've looked at the timeit module, but it seems it's only for small snippets of code. 我已经看过 timeit 模块,但它似乎仅适用于一小段代码。 I want to time the whole program. 我想安排整个节目的时间。 解决方案: 参考一: https://stackoom.com/question/6XC7/我如何获得执行Python程序的时间 参考二: https://oldbug.net/q/6XC7/How-do-I-get-time-of-a-Python-program-s-execution 来源: oschina 链接: https://my.oschina.net/u/4428122/blog/4324985