Skip to content

Instantly share code, notes, and snippets.

@cassler
Last active August 29, 2015 14:02
Show Gist options
  • Save cassler/f3b93f23f18a6ee05e3e to your computer and use it in GitHub Desktop.
Save cassler/f3b93f23f18a6ee05e3e to your computer and use it in GitHub Desktop.
Timed CURL
#!/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}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment