Microsoft Windows CE 3.0  

Using the Sleep Timer

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Windows CE uses the Sleepfunction and the Wait* functions to help control timing and synchronization. In Windows CE 2.x, an OEM sets the frequency and duration of timer calls. Each time the timer is fired, Windows CE 2.x signals the kernel to schedule a new thread. Because of threading, any call to Sleepreturns on a schedule tick. Therefore, a Sleep(1) call is really a Sleep(25) call.

The Windows CE 3.0 OS always sets the timer to 1 millisecond under normal working conditions when there are threads to schedule. Therefore, you can now call Sleep(1) and expect to receive approximately 1> n < 2 ms accuracy. However, the accuracy depends on the priority of your thread, the priority of other threads, and whether ISRs are running.



 Last updated on Tuesday, May 18, 2004

© 2004 Microsoft Corporation. All rights reserved.