Q. About The system timer 
Author Message
 Q. About The system timer

MSDN and some experts says about System Timer Resolution:
        "Windows 95 and later: The system timer runs at approximately 55ms."

Howewer when you run next code under Win98 you get another result:

    int Cnt [100],
         Cnt0 = GetTickCount();
    for (int i=0; i<100; i++)
    {
        Sleep(10);
        Cnt[i] = GetTickCount()-Cnt0;
    }

Here is a typical Cnt[] content:
15, 30 , 40, 51, 65, 81, 96, 106, 120, 130, 140, 151, 165, 180, 190, 205
......
1105,1120,1135,1145,1155,1165,1180,1190,1200,1210,1221,1235

It seems like system timer resolution of Windows 98 is about 5-10 msec.
Where can I read about real Windows 95/98 system timer interval (not about
RTOS in common, Ventur Com RTX,etc :).




Wed, 07 May 2003 03:00:00 GMT  
 Q. About The system timer

Hi

I quote from "Developing Windows NT Drivers". I hope Joe Newcomer and Ed
Dekker don't mind.

"The default interval depends upon the processor and the HAL (Hardware
Abstraction Layer). Typical values are 10mS for a standard x86 uniprocessor
system, 15mS for dual processor x86 system and 7.5mS for an Alpha system"

A way to alter the the system timer is to use the functions timeGetDevCaps()
wich will return the system maximum and minimum values acceptable to the
system. You can then use timeBeginPeriod() to set the required timer
resolution.

If you would like to have acurate timing you will have to use the multimedia
timers.
timeSetEvent(), timeKillEvent are used to create and destroy timers.

HTH

Chris M


Quote:
> MSDN and some experts says about System Timer Resolution:
>         "Windows 95 and later: The system timer runs at approximately
55ms."

> Howewer when you run next code under Win98 you get another result:

>     int Cnt [100],
>          Cnt0 = GetTickCount();
>     for (int i=0; i<100; i++)
>     {
>         Sleep(10);
>         Cnt[i] = GetTickCount()-Cnt0;
>     }

> Here is a typical Cnt[] content:
> 15, 30 , 40, 51, 65, 81, 96, 106, 120, 130, 140, 151, 165, 180, 190, 205
> ......
> 1105,1120,1135,1145,1155,1165,1180,1190,1200,1210,1221,1235

> It seems like system timer resolution of Windows 98 is about 5-10 msec.
> Where can I read about real Windows 95/98 system timer interval (not about
> RTOS in common, Ventur Com RTX,etc :).





Fri, 09 May 2003 03:00:00 GMT  
 Q. About The system timer
Thanks,
it works very well even under Win98 and Win95 without multimedia device.
Eugene.


Fri, 09 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. System.Timers.Timer & System.threading.Timer

2. System.Timers.Timer can't throw Exception?

3. Timers, Timers, Timers...

4. System.Threading.Timer , am I doing this correctly ?

5. System time independent Timer

6. System.Timer.TimeOfDay

7. timer based on a logon system

8. reseting the system idle timer for screen saver

9. System.Threading.Timer is not working properly.

10. System.Threading.Timer question (help!)

11. Use System.Threading.Timer

12. Timer interrupts and timer ticks

 

 
Powered by phpBB® Forum Software