summaryrefslogtreecommitdiffstats
path: root/private/crt32/time/difftime.c
blob: 76797028f184ed12e60a9312c18879884a658ff2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/***
*difftime.c - return difference between two times as a double
*
*	Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved.
*
*Purpose:
*	Find difference between two time in seconds.
*
*Revision History:
*	12-11-87  JCR	Added "_LOAD_DS" to declaration
*	08-15-89  PHG	Made MTHREAD version _pascal
*	11-20-89  JCR	difftime() always _cdecl (not pascal even under
*			mthread)
*	03-20-90  GJF	Replaced _LOAD_DS with CALLTYPE1, added #include
*			<cruntime.h> and fixed the copyright. Also, cleaned
*			up the formatting a bit.
*	10-04-90  GJF	New-style function declarator.
*	05-19-92  DJM	ifndef for POSIX build.
*
*******************************************************************************/

#ifndef _POSIX_

#include <cruntime.h>
#include <time.h>

/***
*double difftime(b, a) - find difference between two times
*
*Purpose:
*	returns difference between two times (b-a)
*
*	Multi-thread version must use pascal calling convention to be re-entrant.
*
*Entry:
*	long a, b - times to difference (actually are time_t values)
*
*Exit:
*	returns a double with the time in seconds between two times
*
*Exceptions:
*
*******************************************************************************/

double _CALLTYPE1 difftime (
	time_t b,
	time_t a
	)
{
	return( (double)( b - a ) );
}

#endif  /* _POSIX_ */