author | wenzelm |
Wed, 11 Jun 2008 18:01:36 +0200 | |
changeset 27152 | 192954a9a549 |
parent 26576 | fc76b7b79ba9 |
child 29145 | b1c6f4563df7 |
permissions | -rw-r--r-- |
18317 | 1 |
# -*- shell-script -*- |
2 |
# $Id$ |
|
3 |
# Author: Makarius |
|
4 |
# |
|
5 |
# timestart - setup bash environment for timing. |
|
6 |
# |
|
7 |
||
8 |
TIMES_RESULT="" |
|
9 |
||
10 |
function get_times () { |
|
11 |
local TMP="/tmp/get_times$$" |
|
12 |
times > "$TMP" # No pipe here! |
|
26576 | 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')" |
18327 | 14 |
rm -f "$TMP" |
18317 | 15 |
} |
16 |
||
17 |
get_times # sets TIMES_RESULT |