Forum Moderators: coopster & phranque

Message Too Old, No Replies

a more precise sleep command? like SLEEP (0.1)

a more precise sleep command? like SLEEP (0.1)

         

affter333

8:16 pm on Jan 30, 2004 (gmt 0)



Hi, I'm new to perl, I was using Sleep(0.1)
but only to found out that it can only be integer
so is there any command/module supports a more
precise time laps?

thanks man.

moltar

8:25 pm on Jan 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use Time::HiRes qw( sleep );

sleep( 0.1 );

Note: sleep() can also return number of floating seconds slept.

dkubb

4:31 am on Feb 2, 2004 (gmt 0)

10+ Year Member



There's a little known way to sleep for fractional seconds using perl's built-in
select()
routine:

select(undef, undef, undef, 0.1);