Skip to content

Instantly share code, notes, and snippets.

@mattrubin
Created November 17, 2011 18:37
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 mattrubin/1374030 to your computer and use it in GitHub Desktop.
Save mattrubin/1374030 to your computer and use it in GitHub Desktop.
Measures the response time of a web page
#!/bin/bash
CURL="/usr/bin/curl"
GAWK="/usr/bin/awk"
echo -n "Please pass the url you want to measure: "
read url
echo " Time_Connect Time_startTransfer Time_total "
while [ true ]
do
URL="$url"
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo $result | $GAWK -F: '{ print $1" "$2" "$3}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment