lib/scripts/timestart.bash
changeset 58639 1df53737c59b
parent 31310 b5365a9db718
equal deleted inserted replaced
58638:5855b9b3d6a3 58639:1df53737c59b
     6 #
     6 #
     7 
     7 
     8 TIMES_RESULT=""
     8 TIMES_RESULT=""
     9 
     9 
    10 function get_times () {
    10 function get_times () {
    11   local TMP="/tmp/get_times$$"
    11   local TMP="${TMPDIR:-/tmp}/get_times$$"
    12   times > "$TMP"   # No pipe here!
    12   times > "$TMP"   # No pipe here!
    13   TIMES_RESULT="$SECONDS $(echo $(cat "$TMP") | perl -pe 's,\d+m\d+\.\d+s \d+m\d+\.\d+s (\d+)m(\d+)\.\d+s +(\d+)m(\d+)\.\d+s, $1 * 60 + $2 + $3 * 60 + $4,e')"
    13   TIMES_RESULT="$SECONDS $(echo $(cat "$TMP") | perl -pe 's,\d+m\d+\.\d+s \d+m\d+\.\d+s (\d+)m(\d+)\.\d+s +(\d+)m(\d+)\.\d+s, $1 * 60 + $2 + $3 * 60 + $4,e')"
    14   rm -f "$TMP"
    14   rm -f "$TMP"
    15 }
    15 }
    16 
    16