Re: redraw, who (xlib/cairo), when...

Glynn Clements <[email protected]>
Newsgroups gmane.comp.freedesktop.xorg,gmane.comp.lib.cairo
Message-ID <[email protected]>
First Last wrote:

> >>                 while(XPending(dpy)==0){
> >>                         usleep(100);
> >>                         updateClock(&myClock);
> >> 
> >
> > Ugh. This causes the process to be scheduled up to 10,000 times per
> > second, which is almost a busy wait. I would expect this process to
> > consume far more CPU than is necessary.
> 
> do you mix up with nanosleep()(http://linux.die.net/man/3/usleep)? 

No.

> so, if I right, I have settled the sleep time at 0.1s

The argument to usleep() is in microseconds. 100 microseconds is
1/10th of a millisecond or 1/10000th of a second.

-- 
Glynn Clements <[email protected]>
_______________________________________________
[email protected]: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.