Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Created March 18, 2016 20:29
Show Gist options
  • Save whyrusleeping/646c97b89ae4501a7eb7 to your computer and use it in GitHub Desktop.
Save whyrusleeping/646c97b89ae4501a7eb7 to your computer and use it in GitHub Desktop.
#!/bin/bash
runs=10
fsize=32
rm timing && touch timing
for i in `seq 25`; do
touch timing-temp
for j in `seq $runs`; do
printf "\r \rsize %s: %s/%s" $fsize $j $runs
file=TESTFILE
dd if=/dev/urandom of=$file bs=$fsize count=1 2> /dev/null
/usr/bin/time -f '%e' ipfs add -q $file > hash 2>> timing-temp
rm $file
done
echo ""
printf "%s," $fsize >> timing
for t in `cat timing-temp`; do
printf "%s," $t >> timing
done
printf "\n" >> timing
rm timing-temp
fsize=$(expr $fsize '*' 2)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment