Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

  1. /***
  2. *difftime.c - return difference between two times as a double
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Find difference between two time in seconds.
  8. *
  9. *Revision History:
  10. * 12-11-87 JCR Added "_LOAD_DS" to declaration
  11. * 08-15-89 PHG Made MTHREAD version _pascal
  12. * 11-20-89 JCR difftime() always _cdecl (not pascal even under
  13. * mthread)
  14. * 03-20-90 GJF Replaced _LOAD_DS with CALLTYPE1, added #include
  15. * <cruntime.h> and fixed the copyright. Also, cleaned
  16. * up the formatting a bit.
  17. * 10-04-90 GJF New-style function declarator.
  18. * 05-19-92 DJM ifndef for POSIX build.
  19. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  20. * 08-30-99 PML Fix function header comment, detab.
  21. *
  22. *******************************************************************************/
  23. #ifndef _POSIX_
  24. #include <cruntime.h>
  25. #include <time.h>
  26. /***
  27. *double difftime(b, a) - find difference between two times
  28. *
  29. *Purpose:
  30. * returns difference between two times (b-a)
  31. *
  32. *Entry:
  33. * time_t a, b - times to difference
  34. *
  35. *Exit:
  36. * returns a double with the time in seconds between two times
  37. *
  38. *Exceptions:
  39. *
  40. *******************************************************************************/
  41. double __cdecl difftime (
  42. time_t b,
  43. time_t a
  44. )
  45. {
  46. return( (double)( b - a ) );
  47. }
  48. #endif /* _POSIX_ */