Roc*_*ock 5 powershell curl response-time
我有一个 curl
命令,它通过调用服务时的每个操作来中断它的响应时间。
curl -w "@sample.txt" -o /dev/null someservice-call
Run Code Online (Sandbox Code Playgroud)
我想使用 PowerShell 的内置功能以类似的方式测量响应时间 Invoke-WebRequest
调用。到目前为止,我能够使用Measure-Command
. 有人可以帮我解决这个问题吗?
内容 sample.txt
用于的curl
:
time_namelookup: %{time_namelookup}\n 时间连接:%{时间连接}\n time_appconnect: %{time_appconnect}\n time_pretransfer: %{time_pretransfer}\n time_redirect: %{time_redirect}\n time_starttransfer: %{time_starttransfer}\n ----------\n time_total: %{time_total}\n
Fal*_*der 10
时间(以毫秒为单位):
$url = "google.com"
(Measure-Command -Expression { $site = Invoke-WebRequest -Uri $url -UseBasicParsing }).Milliseconds
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6400 次 |
最近记录: |