Re: Time::HiRes qw(sleep) fails
Abhijit Menon-Sen [Thu, 19 Jul 2001 04:30:43 +0000 (09:30 +0530)]
Message-Id:  <20010719043043.A10327@lustre.dyn.wiw.org>

p4raw-id: //depot/perl@11409

ext/Time/HiRes/HiRes.xs

index a16dccc..77ce9e2 100644 (file)
@@ -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