Download the PHP package mmdm/sim-benchmark without Composer
On this page you can find all versions of the php package mmdm/sim-benchmark. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mmdm/sim-benchmark
More information about mmdm/sim-benchmark
Files in mmdm/sim-benchmark
Package sim-benchmark
Short Description A simple yet nice benchmark for your codes
License MIT
Informations about the package sim-benchmark
Simplicity Benchmark
A library to benchmark codes time elapsed and memory usage.
Install
composer
Or you can simply download zip file from github and extract it, then put file to your project library and use it like other libraries.
Just add line below to autoload files:
and you are good to go.
How to use
Available functions
start($label):
This method starts a benchmark for a specific label.
Note: This method just work one time for a specific label.
pause($label):
This method pause a benchmark for a specific label.
Note: If you use this method multiple times before resume method, first call will apply.
resume($label):
This method resume a benchmark for a specific label.
Note: If you use this method multiple times before pause method, first call will apply.
stop($label):
This method stop a benchmark for a specific label.
Note: This method just work one time for a specific label.
getTime($label):
This method get time for a specific label.
Note: Use this function before start and stop methods, will cause exception.
Note: Returns time as microseconds in float format
getMemory($label):
This method get memory for a specific label.
Note: Use this function before start and stop methods, will cause exception.
Note: Returns memory as bytes in int format
get($label):
This method get time and memory for a specific label.
Note: Use this function before start and stop methods, will cause exception.
Note: Returns an array like below format
getReport($label):
This method show a report of a specific label.
Note: Use this function before start and stop methods, will cause exception.
Note: This method is void
License
Under MIT license.
All versions of sim-benchmark with dependencies
ext-mbstring Version *