Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ The Be FAQs

Media Vault

Software Library

Restoration Projects

Artifacts Sought

The Be FAQs

  cubeprefsicon graphic [Bar]


The Be FAQs
Developing for BeOS

 

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:
2/3/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)
  [Macro error: Can't compile this script because of a syntax error.]

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