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