<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><span style="font-weight: bold;">Hi Glynn and other guys,</span><br>>> while(XPending(dpy)==0){<br>>> usleep(100);<br>>> updateClock(&myClock);<br>>> <br>><br>>Ugh. This causes the process to be scheduled up to 10,000 times per<br>>second, which is almost a busy wait. I would expect this process to<br>>consume far more CPU than is necessary.<br><span style="font-weight: bold;">do you mix up with
</span><span>nanosleep()</span><span style="font-weight: bold;"> (</span><a href="http://linux.die.net/man/3/usleep">http://linux.die.net/man/3/usleep</a><span style="font-weight: bold;">)? so, if I right, I have settled the sleep time at 0.1s (jwm uses the frequency of the microprocessor to set the sleep time). When I wrote this I expected to get something who works. I will try with </span><span>select()</span><span style="font-weight: bold;"> or </span><span>poll()</span><span style="font-weight: bold;"> as you suggested, it sound better.</span><br><br><span style="font-weight: bold;">thx,</span><br><span style="font-weight: bold;">-Nicoo</span><br><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div class="y_msg_container"><br></div> </div> </div> </div></body></html>