home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Timing / WaitLength.h < prev   
Encoding:
Text File  |  1998-06-17  |  529 b   |  38 lines  |  [TEXT/CWIE]

  1. // WaitLength.h
  2.  
  3. #ifndef WaitLength_h
  4. #define WaitLength_h
  5.  
  6. #ifndef Millisecs_h
  7. #include "Millisecs.h"
  8. #endif
  9. #ifndef Microsecs_h
  10. #include "Microsecs.h"
  11. #endif
  12. #ifndef Assert_h
  13. #include "Assert.h"
  14. #endif
  15.  
  16. class WaitLength
  17.   {
  18.     private:
  19.         int32 value;
  20.     
  21.     public:
  22.         WaitLength( Millisecs time )
  23.           : value( time.Count() )
  24.           {
  25.             Assert( time.Count() >= 0 );
  26.           }
  27.         
  28.         WaitLength( Microsecs time )
  29.           : value( -time.Count() )
  30.           {
  31.             Assert( time.Count() >= 0 );
  32.           }
  33.         
  34.         int32 Value() const        { return value; }
  35.   };
  36.  
  37. #endif
  38.