[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

[patch] wrong display of timers when using --pass



Hi again,

WML display timers sequentially, so that results are wrong if all passes
are not used.
Example:
prompt> wml -v1 -p2 index.tmp1 > /dev/null

Before the patch:
** WML:Verbose: main |  ipp   mhc   epl  gm4  div asub hfix hstr slic | TOTAL
** WML:Verbose: ---- | ---- ----- ----- ---- ---- ---- ---- ---- ---- | ------
** WML:Verbose: 1.09 | 7.51  8.60 |

After:
** WML:Verbose: main |  ipp   mhc   epl  gm4  div asub hfix hstr slic | TOTAL
** WML:Verbose: ---- | ---- ----- ----- ---- ---- ---- ---- ---- ---- | ------
** WML:Verbose: 1.09 |   --  7.51    --   --   --   --   --   --   -- | 8.60

################### File wml-timer.patch #################
--- wml-1.6.7/wml_frontend/wml.src	Wed Mar  4 10:34:36 1998
+++ wml-1.6.7/wml_frontend/wml.src	Fri Jan  1 22:00:39 1999
@@ -1049,7 +1049,7 @@
     $etime = $u + $s + $cu + $cs;
     $dtime = $etime-$stime;
     $dtime = 0.01 if ($dtime < 0);
-    push(@TIMES, $dtime);
+    $TIMES[$p] = $dtime;
     if ($rc != 0) {
         if (rc % 256 != 0) {
             printf(STDERR "** WML:Break: Error in Pass %d (status=%d, rc=%d).\n", $p, $rc % 256, $rc / 256);
@@ -1156,13 +1156,13 @@
 $i  = 1;
 $pt = 0;
 $timestr = '';
-foreach $t (@TIMES) {
+foreach $t (@TIMES[1..9]) {
     $pt += $t;
     if ($i == 2 or $i == 3) {
-        $timestr .= sprintf("%5.2f ", $t);
+        $timestr .= sprintf($t ne '' ? "%5.2f " : "   -- ", $t);
     }
     else {
-        $timestr .= sprintf("%4.2f ", $t);
+        $timestr .= sprintf($t ne '' ? "%4.2f " : "  -- ", $t);
     }
     $i++;
 }
################### EOF  wml-timer.patch #################

Greetings

   Denis

--
D. Barbier
http://imacs.polytechnique.fr

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com