[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: pthread_delay_np

> Arun,
> Could you then tell me how to wait for a specified milli/micro/nano secs
> within a thread? I need that for some network simulation. Does
> pthread_cond_timedwait() sound like a good idea for that (I could create
> a condition that never occurs)? That looks very ugly to me. Is there a
> portable way to wait for an approximate time within a thread?

Look for sleep, usleep and nanosleep(2).