The Trunk: System-nice.647.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-nice.647.mcz

commits-2
Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.647.mcz

==================== Summary ====================

Name: System-nice.647
Author: nice
Time: 25 December 2013, 11:31:22.289 pm
UUID: ca6615b3-c0ba-4d80-96b5-c4f62537ea0f
Ancestors: System-cmm.646

Change a few print:(aFloat roundTo: 0.01) into nextPutAll:(aFloat printShowingMaxDecimalPlaces: 2)

=============== Diff against System-cmm.646 ===============

Item was changed:
  ----- Method: MessageTally class>>tallySendsTo:inBlock:showTree: (in category 'spying') -----
  tallySendsTo: receiver inBlock: aBlock showTree: treeOption
  "
  MessageTally tallySends: [3.14159 printString]
  "
  "This method uses the simulator to count the number of calls on each method
  invoked in evaluating aBlock. If receiver is not nil, then only sends
  to that receiver are tallied.
  Results are presented as leaves, sorted by frequency,
  preceded, optionally, by the whole tree."
  | prev tallies startTime totalTime |
  startTime := Time millisecondClockValue.
  tallies := MessageTally new class: aBlock receiver class method: aBlock method.
  tallies reportOtherProcesses: true. "Do NOT filter nodes with nil process"
  prev := aBlock.
  thisContext sender
  runSimulated: aBlock
  contextAtEachStep: [ :current |
  current == prev ifFalse: [ "call or return"
  prev sender == nil ifFalse: [ "call only"
  (receiver == nil or: [ current receiver == receiver ])
  ifTrue: [ tallies tally: current by: 1 ] ].
  prev := current ] ].
 
+ totalTime := Time millisecondClockValue - startTime // 1000.0.
- totalTime := Time millisecondClockValue - startTime // 1000.0 roundTo: 0.01.
  (StringHolder new contents:
  (String streamContents:
  [:s |
+ s nextPutAll: 'This simulation took ' , (totalTime printShowingMaxDecimalPlaces: 2)
- s nextPutAll: 'This simulation took ' , totalTime printString
  , ' seconds.'; cr.
  treeOption
  ifTrue: [ tallies fullPrintExactOn: s ]
  ifFalse: [ tallies leavesPrintExactOn: s ] ]))
  openLabel: 'Spy Results'!

Item was changed:
  ----- Method: PowerManagement class>>itsyVoltage (in category 'computing') -----
  itsyVoltage
  "On the Itsy, answer the approximate Vcc voltage. The Itsy will shut
  itself down when this value reaches 2.0 volts. This method allows one to
  build a readout of the current battery condition."
  | n |
  n := Smalltalk getSystemAttribute: 1200.
  n
  ifNil: [^ 'no voltage attribute'].
+ ^ (n asNumber / 150.0 printShowingMaxDecimalPlaces: 2) , ' volts'!
- ^ (n asNumber / 150.0 roundTo: 0.01) asString , ' volts'!