This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Waiting without Sleep() possible?


Waiting without Sleep() possible?

Postby efortier » Mar 8, 2004 @ 1:34pm

User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Postby Pejo Software - Per » Mar 8, 2004 @ 2:06pm

I think your only option is to do busy waiting and use a performance counter.
User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


Postby Dan East » Mar 8, 2004 @ 3:01pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Pejo Software - Per » Mar 8, 2004 @ 4:38pm

In Windows CE >= 3 the accuracy of Sleep should be 1-2 ms. On a PC it is not that good.

I did some tests on a Cassiopeia E-115 Pocket PC and on that device Sleep(1) would mean sleeping in 20 ms. This is the behaviour that devices < Windows CE 3 would have, but all modern devices will probably have good Sleep accuracy.
User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


Postby fyf » Mar 11, 2004 @ 1:08pm

fyf
pm Member
 
Posts: 5
Joined: Mar 4, 2004 @ 2:08pm


Postby efortier » Mar 11, 2004 @ 1:43pm

User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Postby fyf » Mar 12, 2004 @ 8:09am

Using socket select command to realize Sleep has some unwanted influence to power monitoring and clock counter registers.
And using GetTickCount is more correct.
fyf
pm Member
 
Posts: 5
Joined: Mar 4, 2004 @ 2:08pm


Postby efortier » Mar 12, 2004 @ 2:03pm

User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Postby Presto » Mar 12, 2004 @ 3:10pm

User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum