action_scheduler_use_cpu_execution_time

action_scheduler_use_cpu_execution_time

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('action_scheduler_use_cpu_execution_time') is found 1 times:

  • /packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php line 277
    	protected function get_execution_time() {
    		$execution_time = microtime( true ) - $this->created_time;
    
    		// Get the CPU time if the hosting environment uses it rather than wall-clock time to calculate a process's execution time.
    		if ( function_exists( 'getrusage' ) && apply_filters( 'action_scheduler_use_cpu_execution_time', defined( 'PANTHEON_ENVIRONMENT' ) ) ) {
    			$resource_usages = getrusage();
    
    			if ( isset( $resource_usages['ru_stime.tv_usec'], $resource_usages['ru_stime.tv_usec'] ) ) {
    				$execution_time = $resource_usages['ru_stime.tv_sec'] + ( $resource_usages['ru_stime.tv_usec'] / 1000000 );
    			}
    		}