Loop::Sustainable::Strategy::ByLoad - Calculates wait interval by load.
use Loop::Sustainable; loop_sustainable { my ( $i, $time_sum ) = @_; #### maybe heavy process } ( sub { my ($i, $time_sum, $rv ) = @_; not defined $rv->[0] ? 1 : 0; }, { strategy => { class => 'ByLoad', args => { load => 0.5 }, } } );
Loop::Sustainable::Strategy::ByLoad provides wait interval time calculated by total execution time and loop execution count, specified load ratio.
The ratio of executed time.
Toru Yamaguchi <zigorou@dena.jp<gt>
This module is licensed under the same terms as Perl itself.
To install Loop::Sustainable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Loop::Sustainable
CPAN shell
perl -MCPAN -e shell install Loop::Sustainable
For more information on module installation, please visit the detailed CPAN module installation guide.