cpu time = user + system;
authorwenzelm
Thu, 01 Dec 2005 18:44:47 +0100
changeset 18322 56554bb23eda
parent 18321 3414557c2dda
child 18323 4365c8d84f69
cpu time = user + system;
lib/scripts/timestart.bash
lib/scripts/timestop.bash
--- a/lib/scripts/timestart.bash	Thu Dec 01 18:41:46 2005 +0100
+++ b/lib/scripts/timestart.bash	Thu Dec 01 18:44:47 2005 +0100
@@ -13,9 +13,8 @@
 function get_times () {
   local TMP="/tmp/get_times$$"
   times > "$TMP"   # No pipe here!
-  TIMES_RESULT="$SECONDS $(tail -1 "$TMP" | "$AUTO_PERL" -pe 's,(\d+)m(\d+)\.\d+s, $1 * 60 + $2,ge')"
+  TIMES_RESULT="$SECONDS $(tail -1 "$TMP" | "$AUTO_PERL" -pe 's,(\d+)m(\d+)\.\d+s +(\d+)m(\d+)\.\d+s, $1 * 60 + $2 + $3 * 60 + $4,e')"
   /bin/rm -f "$TMP"
 }
 
 get_times  # sets TIMES_RESULT
-
--- a/lib/scripts/timestop.bash	Thu Dec 01 18:41:46 2005 +0100
+++ b/lib/scripts/timestop.bash	Thu Dec 01 18:44:47 2005 +0100
@@ -13,7 +13,7 @@
   get_times
   local TIMES_STOP="$TIMES_RESULT"
   local KIND
-  for KIND in 1 2 3
+  for KIND in 1 2
   do
     local START=$(echo "$TIMES_START" | cut -d " " -f $KIND)
     local STOP=$(echo "$TIMES_STOP" | cut -d " " -f $KIND)
@@ -27,8 +27,7 @@
 
     local KIND_NAME
     [ "$KIND" = 1 ] && KIND_NAME="elapsed time"
-    [ "$KIND" = 2 ] && KIND_NAME="user"
-    [ "$KIND" = 3 ] && KIND_NAME="system"
+    [ "$KIND" = 2 ] && KIND_NAME="cpu time"
     local RESULT="${HOURS}:${MINUTES}:${SECS} ${KIND_NAME}"
 
     if [ -z "$TIMES_REPORT" ]; then