Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentime.c
Go to the documentation of this file.
00001 /* 00002 ReactOS Sound System 00003 Timing helper 00004 00005 Author: 00006 Andrew Greenwood (silverblade@reactos.org) 00007 00008 History: 00009 31 May 2008 - Created 00010 00011 Notes: 00012 Have checked timing in DebugView. A 10,000ms delay covered a period 00013 of 124.305 sec to 134.308 sec. Not 100% accurate but likely down to 00014 the delays in submitting the debug strings? 00015 */ 00016 00017 /* 00018 Nanoseconds are fun! You must try some! 00019 1 ns = .000000001 seconds = .0000001 ms 00020 100 ns = .0000001 seconds = .00001 ms 00021 10000 ns = .00001 seconds = .001 ms 00022 1000000 ns = .001 seconds = 1 ms 00023 */ 00024 00025 #include <ntddk.h> 00026 00027 VOID 00028 SleepMs(ULONG Milliseconds) 00029 { 00030 LARGE_INTEGER Period; 00031 00032 Period.QuadPart = -Milliseconds; 00033 Period.QuadPart *= 10000; 00034 00035 KeDelayExecutionThread(KernelMode, FALSE, &Period); 00036 } 00037 00038 ULONG 00039 QuerySystemTimeMs() 00040 { 00041 LARGE_INTEGER Time; 00042 00043 KeQuerySystemTime(&Time); 00044 00045 Time.QuadPart /= 10000; 00046 00047 return (ULONG) Time.QuadPart; 00048 } 00049 Generated on Sun May 27 2012 04:18:16 for ReactOS by
1.7.6.1
|