home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / DIGSHSEC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  903 b   |  40 lines

  1. /*
  2.     digshsec.c
  3.  
  4.     % Function for subtracting two times in hundredths of a second
  5.  
  6.     5/16/88  by Ted.
  7.     Extracted from disp.c
  8.  
  9.     OWL 1.1
  10.     Copyright (c) 1988, by Oakland Group, Inc.
  11.     ALL RIGHTS RESERVED.
  12.  
  13.     Revision History:
  14.     -----------------
  15. */
  16.  
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19. #include "digutil.h"
  20.  
  21. /* -------------------------------------------------------------------------- */
  22.  
  23. unsigned dig_SubHsecs(tstart, time)
  24.     unsigned tstart;                /* starting time of day */
  25.     unsigned time;                    /* current time of day */
  26. /*
  27.     Get the difference between two times-of-day in 1/100 seconds.
  28.     Subtracts tstart from time. The result is always less than TIMER_LIMIT.
  29. */
  30. {
  31.     unsigned diff;
  32.  
  33.     if (time >= tstart) diff = time - tstart;
  34.     else diff = time + TIMER_LIMIT - tstart;
  35.  
  36.     return(diff);
  37. }
  38. /* -------------------------------------------------------------------------- */
  39.  
  40.