ReactOS 0.4.16-dev-197-g92996da
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
27VOID
28SleepMs(ULONG Milliseconds)
29{
31
32 Period.QuadPart = Milliseconds;
33 Period.QuadPart *= -10000;
34
36}
37
40{
42
44
45 Time.QuadPart /= 10000;
46
47 return (ULONG) Time.QuadPart;
48}
49
#define FALSE
Definition: types.h:117
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
static PLARGE_INTEGER Time
Definition: time.c:105
#define KernelMode
Definition: asm.h:34
VOID SleepMs(ULONG Milliseconds)
Definition: time.c:28
ULONG QuerySystemTimeMs()
Definition: time.c:39
uint32_t ULONG
Definition: typedefs.h:59
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ LARGE_INTEGER _In_ ULONG Period
Definition: kefuncs.h:1313