home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-29 | 766 b | 48 lines | [TEXT/CWIE] |
- unit MyProfiler;
-
- interface
-
- procedure StartupProfiler;
-
- implementation
-
- uses
- Profiler, MyStartup;
-
- var
- good:Boolean;
-
- function StartProfiler(var msg: integer): OSStatus;
- var
- err:OSErr;
- begin
- {$unused(msg)}
- err := ProfilerInit(ord(collectDetailed), ord(bestTimeBase), 100, 5);
- good := err = noErr;
- if good then begin
- ProfilerSetStatus(0);
- end;
- StartProfiler := noErr;
- end;
-
- procedure FinishProfiler;
- var
- functionSize :longint;
- stackSize: longint;
- err:OSErr;
- begin
- if good then begin
- ProfilerTerm;
- ProfilerGetDataSizes(functionSize, stackSize);
- err := ProfilerDump('ProfileData');
- Debugger;
- end;
- end;
-
- procedure StartupProfiler;
- begin
- SetStartup(StartProfiler, nil, 0, FinishProfiler);
- end;
-
- end.
-