ReactOS
0.4.16-dev-300-g2aadf2e
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
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
_
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
time.c
Go to the documentation of this file.
1
/*
2
ReactOS Sound System
3
Timing helper
4
5
Author:
6
Andrew Greenwood (silverblade@reactos.org)
7
8
History:
9
31 May 2008 - Created
10
11
Notes:
12
Have checked timing in DebugView. A 10,000ms delay covered a period
13
of 124.305 sec to 134.308 sec. Not 100% accurate but likely down to
14
the delays in submitting the debug strings?
15
*/
16
17
/*
18
Nanoseconds are fun! You must try some!
19
1 ns = .000000001 seconds = .0000001 ms
20
100 ns = .0000001 seconds = .00001 ms
21
10000 ns = .00001 seconds = .001 ms
22
1000000 ns = .001 seconds = 1 ms
23
*/
24
25
#include <ntddk.h>
26
27
VOID
28
SleepMs
(
ULONG
Milliseconds)
29
{
30
LARGE_INTEGER
Period
;
31
32
Period
.
QuadPart
= Milliseconds;
33
Period
.
QuadPart
*= -10000;
34
35
KeDelayExecutionThread
(
KernelMode
,
FALSE
, &
Period
);
36
}
37
38
ULONG
39
QuerySystemTimeMs
()
40
{
41
LARGE_INTEGER
Time
;
42
43
KeQuerySystemTime
(&
Time
);
44
45
Time
.
QuadPart
/= 10000;
46
47
return
(
ULONG
)
Time
.
QuadPart
;
48
}
49
FALSE
#define FALSE
Definition:
types.h:117
KeQuerySystemTime
#define KeQuerySystemTime(t)
Definition:
env_spec_w32.h:570
KeDelayExecutionThread
#define KeDelayExecutionThread(mode, foo, t)
Definition:
env_spec_w32.h:484
void
Definition:
nsiface.idl:2307
Time
static PLARGE_INTEGER Time
Definition:
time.c:105
KernelMode
#define KernelMode
Definition:
asm.h:34
SleepMs
VOID SleepMs(ULONG Milliseconds)
Definition:
time.c:28
QuerySystemTimeMs
ULONG QuerySystemTimeMs()
Definition:
time.c:39
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
_LARGE_INTEGER
Definition:
typedefs.h:103
_LARGE_INTEGER::QuadPart
LONGLONG QuadPart
Definition:
typedefs.h:114
Period
_In_ LARGE_INTEGER _In_ ULONG Period
Definition:
kefuncs.h:1313
sdk
lib
drivers
sound
shared
time.c
Generated on Thu Nov 28 2024 06:13:32 for ReactOS by
1.9.6