Subj : Re: pthread_cond_timedwait problems To : comp.programming.threads From : Ian Date : Sun Aug 14 2005 12:02 pm markh@compro.net wrote: > Actual usec delay from timer = 2059 usecs > > Its obvious it takes gettimeofday around 70 usecs to complete but > both the timings are bogus. The rtom should show 100 and the > gettimeofday > should be around 170. > > Ok lets try 1000000ns (1000us) > > Attempting delay of 1000000 nsec (1000 usecs) > gettimeofday reported delay = 2225 usecs > Actual usec delay from timer = 2164 usecs > > > Whats going on here???? I don't see anything wrong with the program. > Is there something wrong here with this code or is a BUG?? > You are attempting to delay for less than a system tick (what ever that is on your system, typical value would be 10mS), so you are seeing something between 0 and one tick. Why not use nanosleep? Same conditions regarding minimum interval apply though. Ian .