Not profiling 'Delay>>wait'

danielv at netvision.net.il danielv at netvision.net.il
Thu Sep 27 08:38:42 UTC 2001


Aha! I needed that - cool!
Thanks Randal.

Daniel

merlyn at stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "Doug" == Doug Way <doug.way at riskmetrics.com> writes:
> 
> Doug> One thing you can do if you need to set a halt in a frequently called
> Doug> method is to define a global in a workspace such as:
> 
> Doug> FirstHalt := true.
> 
> Doug> And then in your Delay>>wait method, insert a halt like this:
> 
> Doug> FirstHalt ifTrue: [FirstHalt := false.  self halt].
> 
> Doug> This will only halt the first time it runs across this.  Another thing
> Doug> you can do is set up a shiftHalt method that checks to see if shift is
> Doug> pressed, but that's a bit more work.
> 
> There's one of these in the image already!
> 
>         ProtoObject>>doOnlyOnce:
> 
> Go look!
> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!




More information about the Squeak-dev mailing list