home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / difftime.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  956b  |  41 lines

  1. /***
  2. *difftime.c - return difference between two times as a double
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Find difference between two time in seconds.
  8. *
  9. *******************************************************************************/
  10.  
  11.  
  12. #include <cruntime.h>
  13. #include <time.h>
  14.  
  15. /***
  16. *double difftime(b, a) - find difference between two times
  17. *
  18. *Purpose:
  19. *       returns difference between two times (b-a)
  20. *
  21. *       Multi-thread version must use pascal calling convention to be re-entrant.
  22. *
  23. *Entry:
  24. *       long a, b - times to difference (actually are time_t values)
  25. *
  26. *Exit:
  27. *       returns a double with the time in seconds between two times
  28. *
  29. *Exceptions:
  30. *
  31. *******************************************************************************/
  32.  
  33. double __cdecl difftime (
  34.         time_t b,
  35.         time_t a
  36.         )
  37. {
  38.         return( (double)( b - a ) );
  39. }
  40.  
  41.