title: Measure response time using Invoke-WebRequest similar to curl
body: <p>I have a <code>curl</code> command which response time by breaking it by each action in invoking a service.</p>
  
  <pre><code>curl -w "@sample.txt" -o /dev/null someservice-call
  </code></pre>
  
  <p>I want to measure the response time in a similar way using PowerShell's built-in <code>Invoke-WebRequest</code> call. So far I am able to get total response time using <code>Measure-Command</code>. Can someone please help me with this?</p>
  
  <p>Content of <code>sample.txt</code> used in <code>curl</code>:</p>
  
  <pre>
  time_namelookup:  %{time_namelookup}\n               
  time_connect:  %{time_connect}\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
  </pre>