Browse code

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.

Scott Moser authored on 2011/10/07 22:29:29
Showing 1 changed files
... ...
@@ -20,9 +20,6 @@
20 20
 # Sanity Check
21 21
 # ============
22 22
 
23
-# Record the start time.  This allows us to print how long this script takes to run.
24
-START_TIME=`python -c "import time; print time.time()"`
25
-
26 23
 # Warn users who aren't on natty, but allow them to override check and attempt
27 24
 # installation with ``FORCE=yes ./stack``
28 25
 if ! grep -q natty /etc/lsb-release; then
... ...
@@ -666,7 +663,5 @@ fi
666 666
 # Fin
667 667
 # ===
668 668
 
669
-# End our timer and give a timing summary
670
-END_TIME=`python -c "import time; print time.time()"`
671
-ELAPSED=`python -c "print $END_TIME - $START_TIME"`
672
-echo "stack.sh completed in $ELAPSED seconds."
669
+# indicate how long this took to run (bash maintained variable 'SECONDS')
670
+echo "stack.sh completed in $SECONDS seconds."