4.4.8 Instrumentation
- Q How do I time a block?
- A
Time millisecondsToRun: aBlock
- Q How do I profile code?
- A
TimeProfileBrowser spyOn: [ "code to profile" ].
- Q How do I introduce a delay?
- A
(Delay forSeconds: 5) wait.
- Q How do I load method wrappers?
- A
Go to http://www.squeaksource.com/MethodWrappers.html Be sure to load MethodWrappers3.9 for the 3.9 squeak image. An alternative is to use http://www.squeaksource.com/ObjectsAsMethodsWrap.html which implements.run:with:in:#
instead of subclassingCompiledMethod