skillaug/benchmark

Good Performance need to benchmark

v1.0.0 2018-10-12 07:55 UTC

This package is auto-updated.

Last update: 2024-05-14 14:09:17 UTC


README

Find the best solution by using benchmark

Installation

composer require --dev skillaug/benchmark "~1.0.0"

Usages

Basic

\skillaug\Benchmark::begin();

// your codes for benchmark here

\skillaug\Benchmark::end();

example results

Time:                     74 Mili second(s)
Memory_get_usage:         26 Megabyte(s)
Memory_get_peak_usage:    25.961 Megabyte(s)

With unit options

\skillaug\Benchmark::begin([
    'time' => 's', // second(s)
    'memory' => 'kb', // kilobyte(s)
]);

example results

Time:                     0.0759 Second(s)
Memory_get_usage:         26624.06 Kilobyte(s)
Memory_get_peak_usage:    26584.53 Kilobyte(s)

License

The BSD 3-Clause "New" or "Revised" License.