home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / MiscKit1.2.6 / Projects / MiscFindPanel / SearchBench / Timer.h < prev    next >
Encoding:
Text File  |  1993-10-21  |  2.2 KB  |  64 lines

  1. /*
  2.  *  Copyright (c) 1993 Christopher J. Kane.  All rights reserved.
  3.  *
  4.  *  This software is subject to the terms of the MiscKit license
  5.  *  agreement.  Refer to the license document included with the
  6.  *  MiscKit distribution for these terms.
  7.  *
  8.  *  Version: 1.1 (22 October 1993)
  9.  */
  10.  
  11. #import <appkit/appkit.h>
  12. #import "SearchableText.h"
  13.  
  14. // This is a "wrapper" class for the SearchableText protocol--
  15. // it doesn't do any searching, but forwards the methods of the
  16. // protocol to the textObj.  Normally, such wrappers aren't
  17. // needed.  However, to order to time the method calls for this
  18. // example application, rather than instrumenting the MiscFindPanel
  19. // class code, or the code of MiscSearchText, this wrapper class
  20. // was created.
  21.  
  22. // It is set to be the first conformer in the SBApp class by
  23. // the MiscFindPanelClass category to Application.  See the
  24. // documentation for more information on this.
  25.  
  26. // The "index fields" are not currently used.  I was going to try
  27. // and generate some sort of performance index, but decided not
  28. // to.  The fields are still in the .nib file too, just hidden.
  29.  
  30. // The instance variables wallcallms and proccallms are simple
  31. // estimates of the amount of time needed for the timing function
  32. // calls.  This calibration occurs when the Timer class is
  33. // instantiated, in -init.
  34.  
  35. // Any timing results less than 100 ms should be taken with a grain
  36. // of salt.  Function call times and the resolution that can be
  37. // achieved varies with the version of NEXTSTEP being used and the
  38. // type of processor.  If you are getting times near, or below,
  39. // that you need to increase the amount of text being searched.
  40. // At minimum for example, you should be searching 500K of text on
  41. // a NeXT '040 cube running NS 3.1 if you want to do any half-
  42. // serious benchmarking.  Be sure to take into consideration
  43. // memory swapping.  And finally, remember that the code of this
  44. // class isn't intended to be very acurate, just give a general
  45. // idea for fun and curiosity.
  46.  
  47. @interface Timer:Object <SearchableText>
  48. {
  49.   id textObj;
  50.   id messageField;
  51.   id textWallField;
  52.   id textProcField;
  53.   id textIndexField;
  54.   id tbmkWallField;
  55.   id tbmkProcField;
  56.   id tbmkIndexField;
  57.   int wallcallms;
  58.   int proccallms;
  59. }
  60.  
  61. - init;
  62.  
  63. @end
  64.