ReactOS 0.4.16-dev-963-g182f353
difftime.cpp
Go to the documentation of this file.
1//
2// difftime.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The difftime() family of functions, which compute the difference between time
7// values.
8//
10
11
12
13// Computes the difference between two times (b - a). Returns a double with the
14// difference in seconds between the two times. Returns zero if the input is
15// invalid.
16template <typename TimeType>
17static double __cdecl common_difftime(TimeType const b, TimeType const a) throw()
18{
19 _VALIDATE_RETURN_NOEXC(a >= 0 && b >= 0, EINVAL, 0);
20
21 return static_cast<double>(b - a);
22}
23
24extern "C" double __cdecl _difftime32(__time32_t const b, __time32_t const a)
25{
26 return common_difftime(b, a);
27}
28
29extern "C" double __cdecl _difftime64(__time64_t const b, __time64_t const a)
30{
31 return common_difftime(b, a);
32}
#define EINVAL
Definition: acclib.h:90
#define __cdecl
Definition: accygwin.h:79
static double __cdecl common_difftime(TimeType const b, TimeType const a)
Definition: difftime.cpp:17
double __cdecl _difftime32(__time32_t const b, __time32_t const a)
Definition: difftime.cpp:24
double __cdecl _difftime64(__time64_t const b, __time64_t const a)
Definition: difftime.cpp:29
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define _VALIDATE_RETURN_NOEXC(expr, errorcode, retexpr)
#define a
Definition: ke_i.h:78
long __time32_t
Definition: time.h:24
__int64 __time64_t
Definition: corecrt.h:619