How to Time HTTP Requests with CURL

Pavol Kutaj
1 min readMar 17, 2023

--

The aim of this page📝 is to share a simple trick to time curl requests, implemented in powershell, taken from How do I measure request and response times at once using cURL? — Stack Overflow

  • Create curl_format.txt and put the following (keep \n it may be parsed into a newline on Win machines!)
  • Navigate the function to the text file (or put it into PATH/PATHEXT Environmental variables), my implementation in PowerShell’s $profile is.
  • Run it
â–¶ curl_timer example.com
HTTP/1.1 200 OK
Content-Encoding: gzip
Accept-Ranges: bytes
Age: 310661
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Fri, 17 Mar 2023 22:19:53 GMT
Etag: "3147526947+ident"
Expires: Fri, 24 Mar 2023 22:19:53 GMT
Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
Server: ECS (dcb/7EA2)
X-Cache: HIT
Content-Length: 648


--------------REQUEST TIME TABLE-----------------
time_namelookup: 0.009481s
time_connect: 0.117440s
time_appconnect: 0.000000s
time_pretransfer: 0.117552s
time_redirect: 0.000000s
time_starttransfer: 0.234501s
----------
time_total: 0.238975s

LINKS

--

--

No responses yet