Created
November 30, 2012 23:08
-
-
Save Peeja/4179355 to your computer and use it in GitHub Desktop.
Dotfile Benchmarking
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/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