home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / MATH.ZIP / DIFFTIME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.5 KB  |  40 lines

  1. /*------------------------------------------------------------------------
  2.  * filename - difftime.c
  3.  *
  4.  * function(s)
  5.  *        difftime - computes difference between two times
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*[]------------------------------------------------------------[]*/
  9. /*|                                                              |*/
  10. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  11. /*|                                                              |*/
  12. /*|                                                              |*/
  13. /*|     Copyright (c) 1987, 1990 by Borland International        |*/
  14. /*|     All Rights Reserved.                                     |*/
  15. /*|                                                              |*/
  16. /*[]------------------------------------------------------------[]*/
  17.  
  18. #include <_math.h>
  19. #include <time.h>
  20.  
  21. /*---------------------------------------------------------------------------*
  22.  
  23. Name        difftime - computes difference between two times
  24.  
  25. Usage        #include <time.h>
  26.         double difftime(time_t time2, time_t time1);
  27.  
  28. Prototype in    time.h
  29.  
  30. Description    difftime  calculates  the  elapsed  time,  in seconds, from
  31.         time1 to time2
  32.  
  33. Return value    difftime returns the result of its calculation as a double
  34.  
  35. *---------------------------------------------------------------------------*/
  36. double difftime(time_t time2, time_t time1)
  37. {
  38.     return (double) time2 - time1;
  39. }
  40.