Skip to content

Instantly share code, notes, and snippets.

@lucascnr
Last active November 18, 2016 19:40
Show Gist options
  • Save lucascnr/21b177eb1ba625e49804a0b43f10beef to your computer and use it in GitHub Desktop.
Save lucascnr/21b177eb1ba625e49804a0b43f10beef to your computer and use it in GitHub Desktop.
Download a Website N times and get the average, giving as first argument the server name and how many times as the second argument.
#!/bin/usr/bash
BEGIN=$(date -u +%s);
for i in `seq 1 $2`; do
$(wget -H -p --cache=off --delete-after $1 &> /dev/null)
done
END=$(date -u +%s);
echo "The test started at:" $BEGIN;
echo "And ended at:" $END;
echo "The average was:" $(((END-BEGIN)/$2)) "seconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment