Skip to content

Instantly share code, notes, and snippets.

@michaelcontento
Last active August 29, 2015 14:02
Show Gist options
  • Save michaelcontento/9b82eaf44ab5d56d7f61 to your computer and use it in GitHub Desktop.
Save michaelcontento/9b82eaf44ab5d56d7f61 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
sed -i '' -e 's/^antigen bundle/#antigen bundle/' ~/.zshrc
tests=$(grep "#antigen bundle" ~/.zshrc | wc -l)
last_sum=0
for it in $(seq 1 $tests); do
sum=0
name=$(grep '#antigen bundle' ~/.zshrc | head -n 1 | cut -d' ' -f3)
sed -i '' -e '1,/#antigen bundle/s/#//' ~/.zshrc
for is in {1..5}; do
sum=$((sum + $(/usr/bin/time zsh -i -c exit 2>&1 | cut -d" " -f9) ))
done
sum=$((sum / 5))
diff=$((sum - last_sum))
last_sum=$sum
echo "$name\t$diff\t$sum"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment