【发布时间】:2016-04-22 14:27:09
【问题描述】:
我发现我可以用这个命令在 Windows 上测量执行时间:
Measure-Command {start-process python .\script.py -Wait}
而且效果很好。不幸的是,当我尝试运行带有一些(位置和可选)参数的脚本时,我收到一条错误消息,其中
Measure-Command {start-process python .\script.py file.txt 100 -Wait}
我得到错误:
Start-Process:找不到接受参数“file.txt”的位置参数。
没有 Measure-Command 一切正常。
我做错了什么?如何测量带参数的脚本的执行时间?
【问题讨论】:
标签: python windows powershell execution-time