• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

How to sleep Perl for a while?

Hi,
I want my Perl code to sleep for about 10 seconds before going forward.

Can you give me a simple example with a code that compiles?

Thanks,

0
Tolgar
Asked:
Tolgar
1 Solution
 
bjbeckCommented:
Use the sleep() function.

ie:  sleep(10); to wait for 10 seconds to continue execution.

http://perldoc.perl.org/functions/sleep.html
0
 
TintinCommented:
You'll kick yourself when you see the answer.

#!/usr/bin/perl
print "Start\n";
sleep 10;
print "Waited 10 seconds, continuing......\n";

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now