Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to Run a section of code for a particular amount of time ?

by GrandFather (Sage)
on Nov 11, 2016 at 04:56 UTC ( #1175732=note: print w/replies, xml ) Need Help??


in reply to How to Run a section of code for a particular amount of time ?

The simplest way is just to use time. Something like:

my $end = time + 30; while (time < $end) { ... }
Premature optimization is the root of all job security
  • Comment on Re: How to Run a section of code for a particular amount of time ?
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-12-18 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (82 votes). Check out past polls.

    Notices?