mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:02:56 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
32
sdk/lib/ucrt/time/difftime.cpp
Normal file
32
sdk/lib/ucrt/time/difftime.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// difftime.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// The difftime() family of functions, which compute the difference between time
|
||||
// values.
|
||||
//
|
||||
#include <corecrt_internal_time.h>
|
||||
|
||||
|
||||
|
||||
// Computes the difference between two times (b - a). Returns a double with the
|
||||
// difference in seconds between the two times. Returns zero if the input is
|
||||
// invalid.
|
||||
template <typename TimeType>
|
||||
static double __cdecl common_difftime(TimeType const b, TimeType const a) throw()
|
||||
{
|
||||
_VALIDATE_RETURN_NOEXC(a >= 0 && b >= 0, EINVAL, 0);
|
||||
|
||||
return static_cast<double>(b - a);
|
||||
}
|
||||
|
||||
extern "C" double __cdecl _difftime32(__time32_t const b, __time32_t const a)
|
||||
{
|
||||
return common_difftime(b, a);
|
||||
}
|
||||
|
||||
extern "C" double __cdecl _difftime64(__time64_t const b, __time64_t const a)
|
||||
{
|
||||
return common_difftime(b, a);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue