ReactOS  0.4.13-dev-247-g0f29b3f
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 {
31 
32  Period.QuadPart = -Milliseconds;
33  Period.QuadPart *= 10000;
34 
36 }
37 
38 ULONG
40 {
42 
44 
45  Time.QuadPart /= 10000;
46 
47  return (ULONG) Time.QuadPart;
48 }
49 
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
VOID SleepMs(ULONG Milliseconds)
Definition: time.c:28
_In_ LARGE_INTEGER _In_ ULONG Period
Definition: kefuncs.h:1268
ULONG QuerySystemTimeMs()
Definition: time.c:39
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
unsigned int ULONG
Definition: retypes.h:1
static PLARGE_INTEGER Time
Definition: time.c:105
LONGLONG QuadPart
Definition: typedefs.h:112