Skip to content

Instantly share code, notes, and snippets.

@intchloe
Created May 16, 2015 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save intchloe/669cc2608647f6ab5794 to your computer and use it in GitHub Desktop.
Save intchloe/669cc2608647f6ab5794 to your computer and use it in GitHub Desktop.
#!/bin/bash
unset IFS
for i in $(seq "$1")
do
time=$({ time curl -s -A "" -d $2 $3 >/dev/null; } |& grep real | cut -f2 | cut -c3- | tr -d 's')
tmp+=$time"+"
if [ "$i" -eq "$1" ]
then
echo "scale=5;""("${tmp%?}")/${1}" | bc
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment