[Squeak-e] adding eventual sending to Croquet's ScriptProcess and
ScriptScheduler
Robert Withers
rwithers12 at attbi.com
Sat Feb 15 21:47:13 CET 2003
On Saturday, February 15, 2003, at 09:41 PM, Robert Withers wrote:
>
> You can look at the comment of CroquetContext for examples.
Oh, below is the code I ran for the performance measurements with the
eventual sending. The eventual ref is created by sending
#eventualCroquetRef. The eventual sends are: #withAllSubclasses,
#select:, #inject:into:, #contents. #immediateRef sends #waitUntil:.
| start stop |
start := Time millisecondClockValue.
[Transcript
cr;
show: 'Morphs with more than 50 instances ';
show: ((Morph eventualCroquetRef withAllSubclasses
select: [:e | e allInstances size > 50])
inject: (WriteStream on: '')
into: [:stream :class |
stream
cr; tab; tab;
nextPutAll: class asString;
nextPutAll: ' => ';
nextPutAll: class allInstances size asString.
stream]) contents immediateRef.
stop := Time millisecondClockValue.
Transcript
cr; tab; show: 'start time: ', start asString;
cr; tab; show: 'stop time: ', stop asString;
cr; tab; show: 'running time: ', (stop - start) asString, ' ms']
newScript resume.
rob
More information about the Squeak-e
mailing list