假设我想对两个程序进行基准测试:foo.py和bar.py.
是几千次运行和各自的平均值time python foo.py和time python bar.py足够的分析和比较他们的速度? 编辑:此外,如果每个程序的执行次高(假设它不是上述),time仍然可以使用?
time python foo.py
time python bar.py
time
unix linux benchmarking profiling
benchmarking ×1
linux ×1
profiling ×1
unix ×1