talk session

mailhost mkaminsk at cvbnet.prime.com
Fri May 10 02:11:20 AEST 1991


>From article <azK/EJXR7ndok at idunno.Princeton.EDU>, by subbarao at phoenix.Princeton.EDU (Kartik Subbarao):
> In article <1991May7.102219.25557 at ssd.kodak.com> weimer at ssd.kodak.com writes:
>>
>>In article <1991May7.084631.10183 at prl.dec.com>, boyd at prl.dec.com (Boyd
>>Roberts) writes:
>>|> In article <1991May7.000521.28186 at athena.cs.uga.edu>,
>>greg at athena.cs.uga.edu (Greg Whitlock) writes:
>>|> > 		for (i = 0; i < delay; i++)
>>|> > 			;
> You should man usleep(3).

Actually usleep(3) is going away in System V Release 4 (SVr4)
so you can use select(2):

    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/time.h>

    struct timeval      timeout;

    timeout.tv_sec = 0;
    timeout.tv_usec = number_of_microseconds;

    /* call select for it's timeout feature */
    select(1, NULL, NULL, NULL, &timeout);

Of course you may sleep a lot longer than you want -
do to whatever else is happening on the system.

Mark B. Kaminsky   mkaminsk at cvbnet.prime.com
Computervision/Prime Computer, Bedford, Massachusetts, USA



More information about the Comp.unix.questions mailing list