Yes. Find the DTPerformanceSession. This was presented using tools 4.0 . This has been improved in Tools 4.1 .
These documents contain this sample code:
CFStringRef process = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%d"), getpid()); CFErrorRef error = NULL; DTPerformanceSessionRef session = DTPerformanceSessionCreate(NULL, process, NULL, &error); DTPerformanceSessionAddInstrument(session, (CFStringRef)@DTPerformanceSession_TimeProfiler, NULL, NULL, &error); CFMutableArrayRef instrumentIDs = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); CFArrayAppendValue(instrumentIDs, @DTPerformanceSession_TimeProfiler); DTPerformanceSessionStart(session, instrumentIDs, &error); // do something in your app DTPerformanceSessionStop(session, instrumentIDs, &error); DTPerformanceSessionSave(session, (CFStringRef)@"/tmp/myAppProfile", &error); DTPerformanceSessionDispose(session, &error);
Ken thomases
source share