develooper Front page | perl.perl6.internals | Postings from July 2002

Re: [PATCH] usleep, sleep(num)

Thread Previous | Thread Next
From:
Aldo Calpini
Date:
July 23, 2002 07:19
Subject:
Re: [PATCH] usleep, sleep(num)
Message ID:
211911063375.20020723161902@alos.it
Nicholas Clark wrote:
> Does Microsoft give you (well, us) a select() implementation that
> really does honour the microsecond field of the struct timeval
> it's passed?

AFAIK, microseconds are honoured only on sockets, not on filehandles.

> I seem to remember reading somewhere that the most portable way of
> achieving a sub second sleep was to call select() for that period
> waiting on no file descriptors.

well, that was perl5, and guess what the implementation does in
src/win32/win32sck.c ?

  if (!(rd || wr || ex)) {
    if (timeout)
      Sleep(timeout->tv_sec  * 1000 +
            timeout->tv_usec / 1000);     /* do the best we can */


cheers,
Aldo

__END__
$_=q,just perl,,s, , another ,,s,$, hacker,,print;


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About