lib/scripts/timestart.bash
author wenzelm
Mon, 29 Sep 2008 21:26:36 +0200
changeset 28411 93ec7fa3b3a0
parent 26576 fc76b7b79ba9
child 29145 b1c6f4563df7
permissions -rw-r--r--
back to plain Position.report for regular references; ContextPosition.report_visible for decls; report_token/parse_token: back to context-less version;

# -*- 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