From: Abhijit Menon-Sen Date: Thu, 19 Jul 2001 04:30:43 +0000 (+0530) Subject: Re: Time::HiRes qw(sleep) fails X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9d00e575aebafe3654e695fbdbbf992a84f7b30;p=p5sagit%2Fp5-mst-13.2.git Re: Time::HiRes qw(sleep) fails Message-Id: <20010719043043.A10327@lustre.dyn.wiw.org> p4raw-id: //depot/perl@11409 --- diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index a16dccc..77ce9e2 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -276,11 +276,12 @@ usleep(useconds) int useconds void -sleep(fseconds) - NV fseconds +sleep(...) CODE: - int useconds = fseconds * 1000000; - usleep (useconds); + if (items > 0) + usleep((int)(SvNV(ST(0)) * 1000000)); + else + PerlProc_pause(); #endif