Skip to content

Instantly share code, notes, and snippets.

@ormaaj
Created September 11, 2015 10:42
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 ormaaj/0a8bfe4ab5efbf9df12c to your computer and use it in GitHub Desktop.
Save ormaaj/0a8bfe4ab5efbf9df12c to your computer and use it in GitHub Desktop.
$ ( for sh in ksh mksh zsh bash; do "$sh" /dev/fd/3; done ) 3<<\EOF
${ZSH_VERSION+'false'} || emulate ksh
${BASH_VERSION+shopt -s expand_aliases}
${KSH_VERSION+\:} alias integer=typeset
[[ ${!KSH_VERSION} == .sh.version ]] || alias .=
function f {
${1+'false'} || integer depth=$1 iter=$2
if ((!depth--)); then
integer i=$iter
time while ((i--)); do :; done
else
. f
fi
}
f 600 1000000
EOF
real 0m0.23s
user 0m0.23s
sys 0m0.00s
0m3.86s real 0m3.86s user 0m0.00s system
real 0m10.780s
user 0m10.781s
sys 0m0.000s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment