http://www.perlmonks.org?node_id=1175732


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