Python3.8计算代码块或程序的运行时间 实现方法 import time start = time.perf_counter() your_function() end = time.perf_counter() print('Running time: %s Seconds'%(end-start))