It works fine, thanks :)

Le mercredi 17 juin 2009 à 15:29 +0200, Paolo Bonzini a écrit :
> Nicolas Petton wrote:
> > Thanks Paolo, I'll have a look at those classes.
> > 
> > One other question, is there something like the MessageTally class in
> > Squeak?.
> 
> I usually use the code in unsupported/Profile.st:
> 
> Bag subclass: IdentityBag [
>      dictionaryClass [ ^IdentityDictionary ]
> ]
> 
> BlockClosure extend [
> 
> profile [
>      | s profProcess workProcess results |
>      s := Semaphore new.
>      results := IdentityBag new.
>      workProcess := self newProcess.
>      profProcess := [
>          workProcess resume.
>          [
>              (Delay forMilliseconds: 5) wait.
>              workProcess isTerminated
>          ] whileFalse: [
>              results add: workProcess suspendedContext method.
>          ].
>          s signal
>      ] forkAt: Processor highIOPriority.
>      s wait.
>      ^results sortedByCount
> ] ]
> 
> [10000 factorial] profile do: [ :each|each printNl ]

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to