ProcessMonitor.st
changeset 3023 abe1daf204c3
parent 3000 e794a357d7cb
child 3233 7ee8f7099595
equal deleted inserted replaced
3022:1063cadd13f7 3023:abe1daf204c3
   153     "update status display of processes"
   153     "update status display of processes"
   154 
   154 
   155     |oldList list line dIndex interrupted contextCount 
   155     |oldList list line dIndex interrupted contextCount 
   156      aProcess nm st n found running sel space oldSelection
   156      aProcess nm st n found running sel space oldSelection
   157      newSelection numHeaderLines nameLength index
   157      newSelection numHeaderLines nameLength index
   158      con c totalStack sender id gId r skipping|
   158      con c totalStack sender id gId r skipping startTime endTime deltaT|
       
   159 
       
   160     startTime := AbsoluteTime now.
   159 
   161 
   160     numHeaderLines := 2.
   162     numHeaderLines := 2.
   161     space := Character space.
   163     space := Character space.
   162     nameLength := self class nameLengthInList.
   164     nameLength := self class nameLengthInList.
   163 
   165 
   418         ].
   420         ].
   419         "/ cg: must flush here - drawing is done by a background process;
   421         "/ cg: must flush here - drawing is done by a background process;
   420         "/ without the flush, the output may look ugly (delayed)
   422         "/ without the flush, the output may look ugly (delayed)
   421         listView flush
   423         listView flush
   422     ].
   424     ].
       
   425 
       
   426     endTime := AbsoluteTime now.
       
   427     deltaT := (endTime millisecondDeltaFrom:startTime) / 1000.0.
       
   428     "/ Transcript show:deltaT; show:' ' ; showCR:(updateDelay / 10.0).
       
   429     deltaT > (updateDelay / 5) ifTrue:[
       
   430         "/ the update took longer than 20% - make delay longer, to reduce cpu load.
       
   431         updateDelay := updateDelay * 2.
       
   432         "/ Transcript show:'+++ '; showCR:updateDelay.
       
   433     ] ifFalse:[
       
   434         updateDelay > 0.5 ifTrue:[
       
   435             deltaT < (updateDelay / 20) ifTrue:[
       
   436                 "/ the update took less than 5% - make delay smaller for better animation.
       
   437                 updateDelay := (updateDelay / 2) max:0.5.
       
   438                 "/ Transcript show:'--- ';showCR:updateDelay.
       
   439             ].
       
   440         ].
       
   441     ].
       
   442 
   423     updateBlock notNil ifTrue:[
   443     updateBlock notNil ifTrue:[
   424         Processor removeTimedBlock:updateBlock.
   444         Processor removeTimedBlock:updateBlock.
   425         Processor addTimedBlock:updateBlock afterSeconds:updateDelay
   445         Processor addTimedBlock:updateBlock afterSeconds:updateDelay
   426     ]
   446     ]
   427 
   447 
   741 ! !
   761 ! !
   742 
   762 
   743 !ProcessMonitor class methodsFor:'documentation'!
   763 !ProcessMonitor class methodsFor:'documentation'!
   744 
   764 
   745 version
   765 version
   746     ^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.75 2001-04-10 14:26:36 cg Exp $'
   766     ^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.76 2001-06-12 09:57:08 cg Exp $'
   747 ! !
   767 ! !