Skip to content

Instantly share code, notes, and snippets.

@EvanKrall
Created June 1, 2013 22:01
Show Gist options
  • Save EvanKrall/5691852 to your computer and use it in GitHub Desktop.
Save EvanKrall/5691852 to your computer and use it in GitHub Desktop.
function timeit() (
command=("$@")
exec 3>&1
exec 4>&2
time_output=$( ( TIMEFORMAT="%3R"; time "${command[@]}" 1>&3 2>&4; ) 2>&1 )
echo "time output: $time_output"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment