home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 2.ddi / MATHSRC.ZIP / DIFFTIME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.1 KB  |  38 lines

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