Skip to content

Instantly share code, notes, and snippets.

@hamidzr
Created January 8, 2019 17:14
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 hamidzr/8ed5ce4c9e63bf92881c820c1a696a95 to your computer and use it in GitHub Desktop.
Save hamidzr/8ed5ce4c9e63bf92881c820c1a696a95 to your computer and use it in GitHub Desktop.
wget vs curl for simple get operations
#!/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