sub parallel_execute { my $this = shift; foreach my $a (@a_array) { my $pid = $this->{fork_manager}->start and next; my $res = $a->passes_thresholds(); $a->{timer} = Benchmark::Timer->new(); $svc->{timer}->start; $this->{fork_manager}->finish(0,{a => $a, plugin_result => $res}); } } $this->{fork_manager}->run_on_finish( sub { my ($pid, $exit_code, $ident, $exit_signal, $core_dump, $data_structure_reference) = @_; my $a = $data_structure_reference->{a}; if (exists $a->{timer}) { $a->{timer}->stop; debug "took: " . $a->{timer}->report; } });