develooper Front page | perl.perl6.language | Postings from January 2001

Why shouldn't sleep(0.5) DWIM?

Thread Next
From:
Michael G Schwern
Date:
January 30, 2001 01:13
Subject:
Why shouldn't sleep(0.5) DWIM?
Message ID:
20010130041339.B28926@blackrider.aocn.com
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.


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
If you have to shoot, shoot!  Don't talk.
		-- Tuco, "The Good, The Bad And The Ugly"

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About