At 09:43 AM 1/30/2001 -0600, Jarkko Hietaniemi wrote:
>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.
Also there isn't a portable way to do subsecond sleeps. Not that it's
stopped perl before, but on some of the platforms that perl 5 runs on there
isn't *any* way to do it.
I'm up for raising the bar for base OS/C compiler features that this sort
of thing is available.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk