home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / DIGSHSEC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-29  |  936 b   |  46 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-DIG 1.2
  10.     Copyright (c) 1988, by Oakland Group, Inc.
  11.     ALL RIGHTS RESERVED.
  12.  
  13.     Revision History:
  14.     -----------------
  15.      3/28/90 jmd    ansi-fied
  16. */
  17.  
  18. #include "oakhead.h"
  19. #include "disppriv.h"
  20. #include "digutil.h"
  21.  
  22. /* -------------------------------------------------------------------------- */
  23.  
  24. unsigned dig_SubHsecs(unsigned tstart, unsigned time)
  25. /*
  26.     Get the difference between two times-of-day in 1/100 seconds.
  27.     Subtracts tstart from time. The result is always less than TIMER_LIMIT.
  28.  
  29.     'tstart' starting time of day
  30.     'time'     current time of day
  31. */
  32. {
  33.     unsigned diff;
  34.  
  35.     if (time >= tstart) {
  36.         diff = time - tstart;
  37.     }
  38.     else {
  39.         diff = time + TIMER_LIMIT - tstart;
  40.     }
  41.  
  42.     return(diff);
  43. }
  44. /* -------------------------------------------------------------------------- */
  45.  
  46.