Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Created December 4, 2017 17:47
Show Gist options
  • Save joshschmelzle/7c994ccc1c1be5730c294ff03ed8e991 to your computer and use it in GitHub Desktop.
Save joshschmelzle/7c994ccc1c1be5730c294ff03ed8e991 to your computer and use it in GitHub Desktop.
Using cURL to test HTTP response time

cuRL - Measuring HTTP Response Time

A way of measuring HTTP Response Time with cURL.

  • curl is used to transfer data to and from a server
  • in this example curl is used to measure website response time

Usage:

  • curl -w "@curl-format.txt" -o -s www.costco.com

curl-format.txt file:

\n
	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
\n

Time Values

  • time_namelookup - Start to end of name resolution
  • time_connect - Start to end of TCP handshake
  • time_appconnect - Start to end of SSL/SSH handshake
  • time_pretransfer - Start to just before transfer begins
  • time_redirect - Time for redirection to complete
  • time_starttransfer - Start to First Byte of transfer
  • time_total - Time to complete full operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment