Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: timer in perl

by LanX (Saint)
on Feb 20, 2018 at 10:59 UTC ( [id://1209572]=note: print w/replies, xml ) Need Help??


in reply to timer in perl

before the loop

 $start = time;

at the end of the loop

last if time > $start + $duration;

(untested)

OR

 while ( time < $start + $duration)

instead of an endless loop.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1209572]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found