HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/otium.komma.nl/vendor/phpbench/phpbench/docs/customisation/executor.rst
Executors
=========

An executor is responsible for executing your benchmarks. It accepts an
``ExecutionContext`` and returns ``ExecutionResults``.

PHPBench comes with two executor variations:

- The :ref:`executor_remote` executor executes you benchmarks in a separate
  process using a generated template.
- The :ref:`executor_local` executor executes you benchmarks the same process
  (sharing the runtime environment of PHPBench).

This executor will return a constant configured value for each iteration.

.. codeimport:: ../../examples/Extension/Executor/AcmeExecutor.php
  :language: php

You can register it in your :doc:`extension <extension>` as follows:

.. codeimport:: ../../examples/Extension/AcmeExtension.php
  :language: php
  :sections: all,executor_di