Last active
December 28, 2015 10:39
-
-
Save adamstrawson/7488317 to your computer and use it in GitHub Desktop.
Simple bash script to get HTTP response times
This file contains hidden or 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 | |
CURL="/usr/bin/curl" | |
echo -n "Enter Url to test: " | |
read url | |
URL="$url" | |
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL` | |
IFS=':' read -a times <<< "${result}" | |
echo "Results: $URL" | |
echo "------------------------------------------------" | |
echo "| Connect Time | Transfer Start Time | Total |" | |
echo "------------------------------------------------" | |
echo "| ${times[0]}ms | ${times[1]}ms | ${times[2]}ms |" | |
echo "------------------------------------------------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment