good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Configurable CPU/Memory Use Scriptby zek152 (Pilgrim) |
on Jun 30, 2011 at 20:37 UTC ( [id://912241]=note: print w/replies, xml ) | Need Help?? |
Just do a mix of spinwait and sleep(). Note that you will have to finetune what the ratio should be. Also in the while(1) you should put the logic to decide when the program should wake up. Seems like a pretty big waste of CPU though. Might there be a way of running the process with a higher priority?
In Section
Seekers of Perl Wisdom
|
|