资 源 简 介
PLInstrument provides a reproducible instrumentation library, modeled on xUnit. The library is intended to facilitate the instrumentation of performance critical code, and provide comparable results over the lifetime of the code base.
The library was developed primarily for the purpose of measuring code runtime on the iPhone, where CPU resources are significantly constrained.
Examples:
An instrument class
```
@interface PLAffineInstrument : PLInstrumentCase @end
@implementation PLAffineInstrument
- (PLInstrumentResult *) instrumentMirrorTransform {
PLIAbsoluteTime start, finish;
int iterations = 25000;
start = PLICurrentTime();
for (int i = 0 ; i < iterations; i++) {
CGAffineTransform mirrorTransform;
mirrorTransform = CGAffineTransformMakeTranslation(0.0, 200.0f);
mirrorTransform = CGAffineTransformScale(mirrorTransform, 1.0, -1.0);
}
finish = PLICurrentTime();
return [PLInstrumentResult resultWithStart