lib/scripts/timestart.bash
author wenzelm
Sat, 14 Jun 2008 23:52:51 +0200
changeset 27221 31328dc30196
parent 26576 fc76b7b79ba9
child 29145 b1c6f4563df7
permissions -rw-r--r--
proper context for tactics derived from res_inst_tac;

# -*- shell-script -*-
# $Id$
# Author: Makarius
#
# timestart - setup bash environment for timing.
#

TIMES_RESULT=""

function get_times () {
  local TMP="/tmp/get_times$$"
  times > "$TMP"   # No pipe here!
  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')"
  rm -f "$TMP"
}

get_times  # sets TIMES_RESULT