MessageTally.st
changeset 559 8015fde9ae16
parent 264 4cd9760b6de6
child 561 4c7d7e58cc8a
--- a/MessageTally.st	Mon Mar 17 18:19:23 1997 +0100
+++ b/MessageTally.st	Wed Mar 19 12:40:49 1997 +0100
@@ -132,7 +132,7 @@
 spyOn:aBlock interval:ms
     "evaluate aBlock and output time statistic on Transcript"
 
-    |runTime aTally nTally|
+    |runTime aTally nTally err|
 
     aTally := self new.
     runTime := aTally spyOn:aBlock interval:ms.
@@ -145,21 +145,35 @@
         "/ aTally tree inspect.
         nTally := aTally nTally.
         Transcript cr.
-        Transcript showCR:('total execution time: '
-                           , runTime printString , ' ms '
-                           , '(' , nTally printString , ' probes ;'
-                           , ' error >= ' 
-                           , (1000 // nTally / 10.0) printString
-                           , '%)').
+        err := (1000 // nTally / 10.0).
+        err > 0 ifTrue:[
+            Transcript showCR:('total execution time: '
+                               , runTime printString , ' ms '
+                               , '(' , nTally printString , ' probes ;'
+                               , ' error >= ' 
+                               , (1000 // nTally / 10.0) printString
+                               , '%)'
+                              ).
+        ] ifFalse:[
+            Transcript showCR:('total execution time: '
+                               , runTime printString , ' ms '
+                               , '(' , nTally printString , ' probes)'
+                              ).
+        ].
+
         Transcript cr.
         aTally tree printOn:Transcript.
-        Transcript cr.
-        Transcript cr.
+        Transcript cr; cr.
 
-        Transcript showCR:'leafs of calling tree:'.
+        Transcript showCR:'leafs of calling tree (by receiver & implementing method):'.
         Transcript cr.
         aTally tree printLeafsOn:Transcript.
+        Transcript cr; cr.
+
+        Transcript showCR:'method leafs of calling tree (by implementing method only):'.
         Transcript cr.
+        aTally tree printMethodLeafsOn:Transcript.
+        Transcript cr; cr.
 
         "
         aTally statistics.
@@ -178,7 +192,7 @@
      Time millisecondsToRun:[500000 timesRepeat:[#(6 5 4 3 2 1) sort] ]
     "
 
-    "Modified: 18.5.1996 / 15:42:44 / cg"
+    "Modified: 19.3.1997 / 12:38:22 / cg"
 ! !
 
 !MessageTally methodsFor:'accessing'!
@@ -342,5 +356,5 @@
 !MessageTally class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/MessageTally.st,v 1.26 1996-05-18 17:21:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/MessageTally.st,v 1.27 1997-03-19 11:40:30 cg Exp $'
 ! !