Created
January 8, 2019 17:14
-
-
Save hamidzr/8ed5ce4c9e63bf92881c820c1a696a95 to your computer and use it in GitHub Desktop.
wget vs curl for simple get operations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename=abc.tmp | |
url=https://projects.scratch.mit.edu/internalapi/project/99999926/get | |
iters=30 | |
rm $filename > /dev/null 2>&1 | |
echo timing curl for $iters iterations | |
time for iter in `seq 1 $iters`; do | |
curl -s $url -o $filename | |
rm $filename | |
done | |
rm $filename > /dev/null 2>&1 | |
echo timing wget for $iters iterations | |
time for iter in `seq 1 $iters`; do | |
wget -O $filename -q $url | |
rm $filename | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment