Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-07-16 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (330 votes). Check out past polls.

    Notices?