Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
curl timer fetch stackexchange CDNs
#!/bin/bash
REPEAT=20
TIMER=0
function fetchTimer {
URL=$1
CURRENT_TIME=`curl --compressed -w '%{time_total}' -o /dev/null -s $URL`;
TIMER=`echo "$CURRENT_TIME + $TIMER" | bc`
}
for url in "http://sstatic.net/js/full.js" "http://sstatic.stackexchange.netdna-cdn.com/js/full.js" "http://d1d5ue6vu5b30i.cloudfront.net/js/full.js" "http://wac.43df.edgecastcdn.net/8043DF/sstatic/js/full.js"; do
TIMER=0
for (( i=1; i<=$REPEAT; i++ )); do
fetchTimer $url
done
echo $url
echo "scale=2; (1000 * ${TIMER}) / ${REPEAT}" | bc
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.