Skip to content

Instantly share code, notes, and snippets.

@mmaassen
Created November 26, 2013 12:54
Show Gist options
  • Save mmaassen/7657836 to your computer and use it in GitHub Desktop.
Save mmaassen/7657836 to your computer and use it in GitHub Desktop.
#!/bin/bash
CURL=`which curl`
GAWK=`which gawk`
case $1 in
10 )
URL="http://www.speedtest2.nl/download/10mb.bin.zip"
;;
http*)
URL=$1
;;
*)
URL="https://www.google.nl"
;;
esac
echo "Meten met: $URL"
while true; do
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}')"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment