Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
more useful options
 
PerlMonks  

Delaying a loop for a specified time

by Anonymous Monk
on Aug 21, 2001 at 10:53 UTC ( [id://106508]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to insert a delay value into a loop, so that it will wait for a set amount of time, before running the loop again?

Thanks.

Replies are listed 'Best First'.
Re: Delaying a loop for a specified time
by busunsl (Vicar) on Aug 21, 2001 at 10:59 UTC
Re: Delaying a loop for a specified time
by ChOas (Curate) on Aug 21, 2001 at 11:00 UTC
    sleep(number of seconds to sleep);

    or

    select(undef,undef,undef,(number of seconds to sleep));

    When using select you can use millisecond timing like
    filling in 0.5 for a 500 millisecond sleep...

    GreetZ!,
      ChOas

    print "profeth still\n" if /bird|devil/;
Re: Delaying a loop for a specified time
by tune (Curate) on Aug 21, 2001 at 11:22 UTC
    Also try Time::HiRes for split second sleep and for much more features.

    --
    tune

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://106508]
Approved by root
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.