From c4e47ab8586069dea52b86fa939ad8a8deeacc2e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 7 Oct 2011 13:29:29 +0000 Subject: [PATCH] simplify script duration output Bash contains a variable 'SECONDS' that indicates how long the current shell has been alive. It seems sane to just use that to indicate to the user how long the script took. --- stack.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/stack.sh b/stack.sh index f6bf534..fbc75b5 100755 --- a/stack.sh +++ b/stack.sh @@ -20,9 +20,6 @@ # Sanity Check # ============ -# Record the start time. This allows us to print how long this script takes to run. -START_TIME=`python -c "import time; print time.time()"` - # Warn users who aren't on natty, but allow them to override check and attempt # installation with ``FORCE=yes ./stack`` if ! grep -q natty /etc/lsb-release; then @@ -666,7 +663,5 @@ fi # Fin # === -# End our timer and give a timing summary -END_TIME=`python -c "import time; print time.time()"` -ELAPSED=`python -c "print $END_TIME - $START_TIME"` -echo "stack.sh completed in $ELAPSED seconds." +# indicate how long this took to run (bash maintained variable 'SECONDS') +echo "stack.sh completed in $SECONDS seconds."