[Newbies] Efficiently writing to a file

Ian Oversby oversby at googlemail.com
Sun Apr 8 19:13:15 UTC 2007

Is this a reasonable way of writing to a file?  It seems to run a
little slower than I would expect.



| myFile |
myFile := StandardFileStream fileNamed: 'c:/test.txt'

Transcript show: (Time millisecondsToRun: [
    1 to: 10000 do: [
	    :x | myFile nextPutAll: ((x asString) , String crlf)
	]]) asString , ' millseconds' ; cr.

myFile close.

More information about the Beginners mailing list