Skip to content

Instantly share code, notes, and snippets.

@metrofx
Created March 16, 2015 05:55
Show Gist options
  • Save metrofx/001072a6ec3dcc6940ba to your computer and use it in GitHub Desktop.
Save metrofx/001072a6ec3dcc6940ba to your computer and use it in GitHub Desktop.
Measure web page load speed using curl
#!/bin/bash
CURL="/usr/bin/curl"
GAWK="/usr/bin/awk"
URL="$1"
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo "Host: $URL"
echo "Time_Connect Time_start_Transfer Time_total
$(echo $result | $GAWK -F: '{ print $1" "$2" "$3}')
" | column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment