Skip to content

Instantly share code, notes, and snippets.

@tvlooy
Created March 7, 2018 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvlooy/711b268aa02e7ff85c0c2253a572d605 to your computer and use it in GitHub Desktop.
Save tvlooy/711b268aa02e7ff85c0c2253a572d605 to your computer and use it in GitHub Desktop.
curl ttfb
# Connect: %{time_connect}
# TTFB: %{time_starttransfer}
# Total time: %{time_total}
while [ true ]; do curl -o /dev/null -s -w "%{time_starttransfer}\n" https://www......./; sleep 15; done
@tvlooy
Copy link
Author

tvlooy commented Mar 7, 2024

$ cat req.txt 
     time_namelookup:  %{time_namelookup}s\n
        time_connect:  %{time_connect}s\n
     time_appconnect:  %{time_appconnect}s\n
    time_pretransfer:  %{time_pretransfer}s\n
       time_redirect:  %{time_redirect}s\n
  time_starttransfer:  %{time_starttransfer}s\n
                     ----------\n
          time_total:  %{time_total}s\n

$ curl -w "@req.txt" -o /dev/null -s https://www.wikipedia.org/
     time_namelookup:  0.001214s
        time_connect:  0.006000s
     time_appconnect:  0.019553s
    time_pretransfer:  0.019680s
       time_redirect:  0.000000s
  time_starttransfer:  0.029238s
                     ----------
          time_total:  0.035235s

@tvlooy
Copy link
Author

tvlooy commented Apr 8, 2024

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment