How fast should I poll the mouse for position chan
|
|
|
Developing for BeOS
BeOS Internals
How fast should I poll the mouse for position changes? Should I just sit in a tight GetMouse(...) loop?
|
Developing for BeOS:
BeOS Internals
|
FAQ Number:
FAQ-0171
|
Last Modified:
3/31/98
|
Keywords:
BeOS,
Developing,
Internals,
interrupt,
mouse,
position,
GetMouse
|
|
If you poll the mouse position, do use a sleep time somewhere in the loop, otherwise you will waste a full CPU getting the mouse position 10,000 times per second!
For example:
while(xyz)
{GetMouse(&a_point etc...);
snooze(X microseconds);}
As a rule of thumb, polling about 50 times a second (i.e., every 20,000 +/- microseconds) seems about right.
|
|
|
Copyright ©1998 Be, Inc.
Be is a registered trademark, and BeOS, BeBox, BeWare, GeekPort, the Be logo
and the BeOS logo are trademarks of Be, Inc. All other trademarks mentioned
are the property of their respective owners.
Icons used herein are the property of Be Inc. All rights reserved.
Comments about this site? Please write us at webmaster@be.com.
|