Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ How fast should I poll the mouse for position chan

Media Vault

Software Library

Restoration Projects

Artifacts Sought

How fast should I poll the mouse for position chan

  cubeprefsicon graphic [Bar]


Developing for BeOS
BeOS Internals

 

How fast should I poll the mouse for position changes? Should I just sit in a tight GetMouse(...) loop?

Top Up << >>
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.


<< Does the BeOS allow for a preemptable kernel and nested interrupts?  Can I get source code for the mouse driver?  >>


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.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026