ReactOS
0.4.16-dev-983-g23ad936
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
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 Thu Apr 17 2025 06:07:15 for ReactOS by
1.9.6