PHPackages                             macocci7/php-benchmark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. macocci7/php-benchmark

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

macocci7/php-benchmark
======================

Simple Benchmark script for PHP.

v0.4.3(5mo ago)124MITPHP

Since Jan 9Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/macocci7/PHP-Benchmark)[ Packagist](https://packagist.org/packages/macocci7/php-benchmark)[ RSS](/packages/macocci7-php-benchmark/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (11)Used By (0)

PHP-Benchmark
=============

[](#php-benchmark)

A Simple, single file Benchmark Script For PHP.

1. Contents
-----------

[](#1-contents)

- 1. Contents
- [2. Requirements](#2-requirements)
- [3. Installation](#3-installation)
- [4. Usage](#4-usage)
    - [4.1. Usage: Run Single Code](#41-usage-run-single-code)
    - [4.2. Usage: Run Multiple Codes](#42-usage-run-multiple-codes)
    - [4.3. Usage: Getting Results as an Array](#43-usage-getting-results-as-an-array)
    - [4.4. Usage: Displaying Analyzed Results](#44-usage-displaying-analyzed-results)
    - [4.5. Usage: Getting Analyzed Results as an Array](#45-usage-getting-analyzed-results-as-an-array)
- [5. Examples](#5-examples)
- [6. LICENSE](#6-license)

2. Requirements
---------------

[](#2-requirements)

- PHP 8.1 or later
- (Optional) git
- (Optional) Composer

3. Installation
---------------

[](#3-installation)

There're several options:

- Option 1: Copy or download [Benchmark.php](src/Benchmark.php) to your environment

    and `require` the code in your PHP, instead of `vendor/autoload.php`.

    This is the most simple way.
- Option 2: Clone this repository to your envenronment

    ```
    git clone https://github.com/macocci7/PHP-Benchmark.git
    ```
- Option 3: Download Zip from [GitHub Repository](https://github.com/macocci7/PHP-Benchmark)

    Click **\[Code\]** button and Click **\[Download Zip\]**.

    Then, extract zip and copy `src/Benchmark.php` to your environment.
- Option 4: Use Composer

    ```
    composer require macocci7/php-benchmark
    ```

4. Usage
--------

[](#4-usage)

### 4.1. Usage: Running Single Code

[](#41-usage-running-single-code)

- PHP:

    ```
