TestCase>>#sampleAnalysisFor: of SUnitBrowser gave the idea to write the following small utility method for the Class Block:
- Code: Select all
| sampler |
sampler := EsbSampler spyOn: self.
Now we can at every place in the code, in the debugger or after having started any kind of big application make a performance analysis of a piece of code by executing simply [...] benchmarkAndBrowse without the need to start Benchmark Workshop and to write a test. Only put your code in the block or put some brackets around your code and send benchmarkAndBrowse!
For small code pieces I use
EsbTimer microsecondsToRun: [...]