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.
This commit is contained in:
Scott Moser 2011-10-07 13:29:29 +00:00 committed by Scott Moser
parent 94c889ac15
commit c4e47ab858

View file

@ -20,9 +20,6 @@
# Sanity Check # 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 # Warn users who aren't on natty, but allow them to override check and attempt
# installation with ``FORCE=yes ./stack`` # installation with ``FORCE=yes ./stack``
if ! grep -q natty /etc/lsb-release; then if ! grep -q natty /etc/lsb-release; then
@ -666,7 +663,5 @@ fi
# Fin # Fin
# === # ===
# End our timer and give a timing summary # indicate how long this took to run (bash maintained variable 'SECONDS')
END_TIME=`python -c "import time; print time.time()"` echo "stack.sh completed in $SECONDS seconds."
ELAPSED=`python -c "print $END_TIME - $START_TIME"`
echo "stack.sh completed in $ELAPSED seconds."