Skip to content

Instantly share code, notes, and snippets.

@Peeja
Created November 30, 2012 23:08
Show Gist options
  • Save Peeja/4179355 to your computer and use it in GitHub Desktop.
Save Peeja/4179355 to your computer and use it in GitHub Desktop.
Dotfile Benchmarking
#!/bin/zsh
export TIMEFMT='%E'
main() {
echo "Purging the disk cache..."
purge
# time's output is on stderr.
zsh_elapsed_time=$( (time zsh -ilc exit) 2>&1 )
echo "zsh:\t$zsh_elapsed_time"
# As above, and also vim wants its stdout to be the terminal.
vim_elapsed_time=$( (time vim +q) 2>&1 >$(tty) )
echo "vim:\t$vim_elapsed_time"
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment