WP_Background_Process::time_exceeded()protectedWC 1.0

Time exceeded.

Ensures the batch never exceeds a sensible time limit. A timeout limit of 30s is common on shared hosting.

Method of the class: WP_Background_Process{}

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->time_exceeded();

WP_Background_Process::time_exceeded() code WC 8.7.0

protected function time_exceeded() {
	$finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds
	$return = false;

	if ( time() >= $finish ) {
		$return = true;
	}

	return apply_filters( $this->identifier . '_time_exceeded', $return );
}