WordPress at Your Fingertips
function is not described

ActionScheduler_Abstract_QueueRunner::time_likely_to_be_exceeded() protected WC 1.0

Check if the host's max execution time is (likely) to be exceeded if processing more actions.

{} It's a method of the class: ActionScheduler_Abstract_QueueRunner{}

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->time_likely_to_be_exceeded( $processed_actions );
$processed_actions(int) (required)
The number of actions processed so far - used to determine the likelihood of exceeding the time limit if processing another action

Code of ActionScheduler_Abstract_QueueRunner::time_likely_to_be_exceeded() WC 6.1.1

protected function time_likely_to_be_exceeded( $processed_actions ) {

	$execution_time        = $this->get_execution_time();
	$max_execution_time    = $this->get_time_limit();
	$time_per_action       = $execution_time / $processed_actions;
	$estimated_time        = $execution_time + ( $time_per_action * 3 );
	$likely_to_be_exceeded = $estimated_time > $max_execution_time;

	return apply_filters( 'action_scheduler_maximum_execution_time_likely_to_be_exceeded', $likely_to_be_exceeded, $this, $processed_actions, $execution_time, $max_execution_time );
}