Created
March 18, 2019 15:02
-
-
Save ZiTAL/14c8e66d7a53804a539c8a86edb8a77a to your computer and use it in GitHub Desktop.
curl: get response time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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