Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by GrandFather (Sage)
on Nov 11, 2016 at 09: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 contemplating the Monastery: (6)
As of 2018-09-25 20:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (205 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!