Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: making something happen in real time

by bcrowell2 (Friar)
on Nov 06, 2005 at 21:58 UTC ( #506161=note: print w/replies, xml ) Need Help??


in reply to Re: making something happen in real time
in thread making something happen in real time

Well, I could just spin in a tight loop instead of using select, but I'd like to avoid having my program be a cpu hog when it shouldn't have any need to be. I don't think sleeping for shorter intervals will help, because it just seems to require several hundred milliseconds to get the cpu back from xscreensaver, and that's a lot longer than the timing resolution I need.
  • Comment on Re^2: making something happen in real time

Replies are listed 'Best First'.
Re^3: making something happen in real time
by bageler (Hermit) on Nov 07, 2005 at 07:05 UTC
    Well, it sounds like that's what you should do to me. If there's a swinging blade (xscreensaver) and you want to dodge between it (beep) you have to have better time resolution than the period of the pendulum. Maybe you could increase the resolution only near the time when the screensaver should be kicking in? Then, for the majority of the time, you can be less of a cpu hog. That would still leave you vulnerable to anything else that might be going on in your system that also has a high resolution.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://506161]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-12-02 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?