Skip to content

Instantly share code, notes, and snippets.

@adamstrawson
Last active December 28, 2015 10:39

Revisions

  1. adamstrawson revised this gist Nov 17, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion httpResponse.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ read url

    URL="$url"
    result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
    IFS=':' read -a time <<< "${result}"
    IFS=':' read -a times <<< "${result}"


    echo "Results: $URL"
  2. adamstrawson created this gist Nov 15, 2013.
    17 changes: 17 additions & 0 deletions httpResponse.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash
    CURL="/usr/bin/curl"

    echo -n "Enter Url to test: "
    read url

    URL="$url"
    result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
    IFS=':' read -a time <<< "${result}"


    echo "Results: $URL"
    echo "------------------------------------------------"
    echo "| Connect Time | Transfer Start Time | Total |"
    echo "------------------------------------------------"
    echo "| ${times[0]}ms | ${times[1]}ms | ${times[2]}ms |"
    echo "------------------------------------------------"