home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / PNL Libraries / MyProfiler.p < prev    next >
Encoding:
Text File  |  1995-08-10  |  554 b   |  39 lines  |  [TEXT/CWIE]

  1. unit MyProfiler;
  2.  
  3. interface
  4.  
  5.     procedure StartProfiler;
  6.     procedure FinishProfiler;
  7.     
  8. implementation
  9.  
  10.     uses
  11.         Profiler;
  12.     
  13.     var
  14.         good:Boolean;
  15.         
  16.     procedure StartProfiler;
  17.         var
  18.             err:OSErr;
  19.     begin
  20.         err := ProfilerInit(collectDetailed, ticksTimeBase, 100, 5);
  21.         good := err = noErr;
  22.     end;
  23.     
  24.     procedure FinishProfiler;
  25.         var
  26.             functionSize :longint;
  27.             stackSize: longint;
  28.             err:OSErr;
  29.     begin
  30.         if good then begin
  31.             ProfilerTerm;
  32.             ProfilerGetDataSizes(functionSize, stackSize);
  33.             err := ProfilerDump('ProfileData');
  34.             Debugger;
  35.         end;
  36.     end;
  37.     
  38. end.
  39.