Hi Experts!!
I have tried all kinds of Timers on Windows and I was not able to get a Time
Function fired at 4 ms exactaly even though
DDK documentation says that the granualrity for Timer is in nano
seconds/Milli seconds in case of NDISMSetTimer/KeTimer.
Iam using the following technique ot get a “Window” of 4 milli Seconds.
Please tell if its in any ways usefull!!
Using RDTSC , I measure the cycles and compute the number of cycles required
for 4 milli seconds.
I have a routine which doess some junk operations and gives me delay of 4
milliseconds
(I know this works with 99 % accuracy…after lot of testing).
I have a 2.6 GHz intel p4 with HT - Win 2000.So after testing all these
timers I know that the minimum scheduling time is 15 ms
(even though I set a timer for 4 ms ) .
I start 3 timers like this "
…
…
Initialize Timers
…
startTimer1
Delay(4 milliseconds) // I know this works
startTimer2
Delay(4 milliseconds) // I know this works
startTimer3
…
…
So logically I should get a timer running every 4 milliseconds.
Anybody please !! tell me if the OS would screw up the time gap ??
Any Ideas on how to get a code running every 4 milliseconds.??
Thanx in Advance
Regards,
Manohara
Windows has a timer granularity of around 10ms, there are techniques that
will push this to 1ms but they are not recomended for general use since they
impact performance of the whole system. Note even with 10ms, if you are
using a DPC routine, there is enough potential variance you will not get an
accurate timer.
You should redesign your approach to get rid of the 4ms timer requirement.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
“Manohara.K” wrote in message news:xxxxx@ntdev…
> Hi Experts!!
>
> I have tried all kinds of Timers on Windows and I was not able to get a
Time
> Function fired at 4 ms exactaly even though
> DDK documentation says that the granualrity for Timer is in nano
> seconds/Milli seconds in case of NDISMSetTimer/KeTimer.
>
> Iam using the following technique ot get a “Window” of 4 milli Seconds.
> Please tell if its in any ways usefull!!
>
> Using RDTSC , I measure the cycles and compute the number of cycles
required
> for 4 milli seconds.
> I have a routine which doess some junk operations and gives me delay of 4
> milliseconds
> (I know this works with 99 % accuracy…after lot of testing).
>
> I have a 2.6 GHz intel p4 with HT - Win 2000.So after testing all these
> timers I know that the minimum scheduling time is 15 ms
> (even though I set a timer for 4 ms ) .
>
> I start 3 timers like this "
> …
> …
> Initialize Timers
> …
> startTimer1
> Delay(4 milliseconds) // I know this works
> startTimer2
> Delay(4 milliseconds) // I know this works
> startTimer3
> …
> …
> So logically I should get a timer running every 4 milliseconds.
>
> Anybody please !! tell me if the OS would screw up the time gap ??
>
> Any Ideas on how to get a code running every 4 milliseconds.??
>
> Thanx in Advance
>
> Regards,
> Manohara
>
>
>
>
U can try using
KeStallExecutionProcessor(milliseconds);
Regards,
Shiva P
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Manohara.K
Sent: Monday, August 09, 2004 5:14 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Windows Timers
Hi Experts!!
I have tried all kinds of Timers on Windows and I was not able to get a
Time
Function fired at 4 ms exactaly even though
DDK documentation says that the granualrity for Timer is in nano
seconds/Milli seconds in case of NDISMSetTimer/KeTimer.
Iam using the following technique ot get a “Window” of 4 milli Seconds.
Please tell if its in any ways usefull!!
Using RDTSC , I measure the cycles and compute the number of cycles
required
for 4 milli seconds.
I have a routine which doess some junk operations and gives me delay of
4
milliseconds
(I know this works with 99 % accuracy…after lot of testing).
I have a 2.6 GHz intel p4 with HT - Win 2000.So after testing all these
timers I know that the minimum scheduling time is 15 ms
(even though I set a timer for 4 ms ) .
I start 3 timers like this "
…
…
Initialize Timers
…
startTimer1
Delay(4 milliseconds) // I know this works
startTimer2
Delay(4 milliseconds) // I know this works
startTimer3
…
…
So logically I should get a timer running every 4 milliseconds.
Anybody please !! tell me if the OS would screw up the time gap ??
Any Ideas on how to get a code running every 4 milliseconds.??
Thanx in Advance
Regards,
Manohara
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Really unfriendly, and it won’t help either if you’re running at passive
level because you’ll still get task-switched out occasionally.
xxxxx@wipro.com wrote:
U can try using
KeStallExecutionProcessor(milliseconds);
Regards,
Shiva P
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Manohara.K
Sent: Monday, August 09, 2004 5:14 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Windows Timers
Hi Experts!!
I have tried all kinds of Timers on Windows and I was not able to get a
Time
Function fired at 4 ms exactaly even though
DDK documentation says that the granualrity for Timer is in nano
seconds/Milli seconds in case of NDISMSetTimer/KeTimer.
Iam using the following technique ot get a “Window” of 4 milli Seconds.
Please tell if its in any ways usefull!!
Using RDTSC , I measure the cycles and compute the number of cycles
required
for 4 milli seconds.
I have a routine which doess some junk operations and gives me delay of
4
milliseconds
(I know this works with 99 % accuracy…after lot of testing).
I have a 2.6 GHz intel p4 with HT - Win 2000.So after testing all these
timers I know that the minimum scheduling time is 15 ms
(even though I set a timer for 4 ms ) .
I start 3 timers like this "
…
…
Initialize Timers
…
startTimer1
Delay(4 milliseconds) // I know this works
startTimer2
Delay(4 milliseconds) // I know this works
startTimer3
…
…
So logically I should get a timer running every 4 milliseconds.
Anybody please !! tell me if the OS would screw up the time gap ??
Any Ideas on how to get a code running every 4 milliseconds.??
Thanx in Advance
Regards,
Manohara
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
–
…/ray..
Please remove “.spamblock” from my email address if you need to contact
me outside the newsgroup.