Measure response time through curl

Here is a little script which show you how you can pull the response time of a website. This idea was pulled from an IBM articles and a script was written to do this. Here is the script:

touch curlcheck
vim curlcheck

and insert the following:

#!/bin/bash
CURL="/usr/bin/curl"
GAWK="/usr/bin/gawk"
echo -n "Please pass the url you want to measure: "
read url
URL="$url"
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo " Time_Connect Time_startTransfer Time_total "
echo $result | $GAWK -F: '{ print $1" "$2" "$3}'

to save the file
:wq
then
chmod +x curlcheck
run the script

root@server:~#:sudo ./curlcheck
Please pass the url you want to measure: http://domain.com
Time_Connect Time_startTransfer Time_total
1.122 3.455 9.205

voila!

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....