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.7.1

apply_filters('action_scheduler_use_cpu_execution_time') is found 1 times:

  • /packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php line 289
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    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 );
            }
        }