ReactOS
0.4.15-dev-8614-gbc76250
clock.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: LGPL, See LGPL.txt in the top level directory
3
* PROJECT: ReactOS CRT library
4
* FILE: lib/sdk/crt/time/clock.c
5
* PURPOSE: Implementation of clock()
6
* PROGRAMER: Timo Kreuzer
7
*/
8
#include <precomp.h>
9
10
ULARGE_INTEGER
g_StartupTime
;
11
12
void
13
initclock
(
void
)
14
{
15
GetSystemTimeAsFileTime
((
FILETIME
*)&
g_StartupTime
);
16
}
17
18
/******************************************************************************
19
* \name clock
20
* \brief Returns the current process's elapsed time.
21
*/
22
clock_t
23
clock
(
void
)
24
{
25
ULARGE_INTEGER
Time
;
26
27
GetSystemTimeAsFileTime
((
FILETIME
*)&
Time
);
28
Time
.
QuadPart
-=
g_StartupTime
.
QuadPart
;
29
return
(
clock_t
)
FileTimeToUnixTime
((
FILETIME
*)&
Time
,
NULL
);
30
};
NULL
#define NULL
Definition:
types.h:112
GetSystemTimeAsFileTime
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition:
time.c:128
clock_t
__kernel_clock_t clock_t
Definition:
linux.h:257
Time
static PLARGE_INTEGER Time
Definition:
time.c:105
clock
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition:
clock.c:23
FileTimeToUnixTime
static __inline __time64_t FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
Definition:
time.h:14
initclock
void initclock(void)
Definition:
clock.c:13
g_StartupTime
ULARGE_INTEGER g_StartupTime
Definition:
clock.c:10
_FILETIME
Definition:
mapidefs.h:60
_ULARGE_INTEGER
Definition:
ms-dtyp.idl:184
_ULARGE_INTEGER::QuadPart
ULONGLONG QuadPart
Definition:
ms-dtyp.idl:185
_LARGE_INTEGER::QuadPart
LONGLONG QuadPart
Definition:
typedefs.h:114
sdk
lib
crt
time
clock.c
Generated on Sat Sep 7 2024 06:06:03 for ReactOS by
1.9.6