On Tue, Jan 30, 2001 at 04:13:39AM -0500, Michael G Schwern wrote:
> Is there any really good reason why sleep() doesn't work for
> microseconds?  I mean, if I can do this:
> 
>     sub sleep {
>         my($time) = shift;
>         if( /^[+-]?\d+$/ ) {
>             sleep($time);
>         }
>         else {
>             select(undef, undef, undef, $time);
>         }
>     }
> 
> Why can't Perl?  Smells like a C holdover to me.

I guess it's part of the can of sub-second worms: if we do sleep(),
people will ask why don't we do time() and alarm(), too.  sleep() and
alarm() we could get away with more easily, but changing time() to do
subsecond granularity would be A Bad Thing for backward compatibility.
Think of generated filenames, or various logs with timestamps.  We can
(hopefully) do a magical p52p6 translator, but fixing the existing
data is a tad harder.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to