if ($self->{times_round}++ < $self->{wait_this_many_times}) { return; # brake by counting loops } #### $self->{timer} ||= time; if (time - $self->{timer} < $self->{min_interval}) { return; # brake by counting seconds } $self->{timer} = time;