Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Created March 18, 2019 15:02
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 ZiTAL/14c8e66d7a53804a539c8a86edb8a77a to your computer and use it in GitHub Desktop.
Save ZiTAL/14c8e66d7a53804a539c8a86edb8a77a to your computer and use it in GitHub Desktop.
curl: get response time
#!/bin/bash
# based on:
# https://stackoverflow.com/a/47944496/454827
# https://stackoverflow.com/a/49502232/454827
#curl --silent --output /dev/null -w "
#namelookup: %{time_namelookup}s\n\
#connect: %{time_connect}s\n\
#appconnect: %{time_appconnect}s\n\
#pretransfer: %{time_pretransfer}s\n\
#redirect: %{time_redirect}s\n\
#starttransfer: %{time_starttransfer}s\n\
#-------------------------\n\
#total: %{time_total}s\n" "$@"
echo "url: "$1
curl --silent --output /dev/null -w "time: %{time_total}s\n" "$@"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment