Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Delaying a loop for a specified time

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

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 14:59 UTC
Re: Delaying a loop for a specified time
by ChOas (Curate) on Aug 21, 2001 at 15: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 15: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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-24 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found