Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * difftime.c
  3.  * Original Author:     G. Haley
  4.  */
  5.  
  6. /*
  7. FUNCTION
  8. <<difftime>>---subtract two times
  9.  
  10. INDEX
  11.         difftime
  12.  
  13. ANSI_SYNOPSIS
  14.         #include <time.h>
  15.         double difftime(time_t <[tim1]>, time_t <[tim2]>);
  16.  
  17. TRAD_SYNOPSIS
  18.         #include <time.h>
  19.         double difftime(<[tim1]>, <[tim2]>)
  20.         time_t <[tim1]>;
  21.         time_t <[tim2]>;
  22.  
  23. DESCRIPTION
  24. Subtracts the two times in the arguments: `<<<[tim1]> - <[tim2]>>>'.
  25.  
  26. RETURNS
  27. The difference (in seconds) between <[tim2]> and <[tim1]>, as a <<double>>.
  28.  
  29. PORTABILITY
  30. ANSI C requires <<difftime>>, and defines its result to be in seconds
  31. in all implementations.
  32.  
  33. <<difftime>> requires no supporting OS subroutines.
  34. */
  35.  
  36. #include <time.h>
  37.  
  38. double
  39. _DEFUN (difftime, (tim1, tim2),
  40.         time_t tim1 _AND
  41.         time_t tim2)
  42. {
  43.   return (double)(tim1 - tim2);
  44. }
  45.