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

Re: [PATCH] usleep, sleep(num)

Thread Previous | Thread Next
Aldo Calpini
July 23, 2002 07:19
Re: [PATCH] usleep, sleep(num)
Message ID:
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 */


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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About