A single-method PHP 5.3+ benchmarking utility
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Bench.php
README.md

README.md

Bench - A single-method PHP 5.3+ benchmarking utility

Keep track of milliseconds passed and memory usage throughout a script's execution. Simply call Bench::mark() at the end of each step (with an optional note), then call it again at the end passing a true boolean to have it print the output. If you also set $raw to true, it will output the memory without rounding to KB.

Usage:

<?php

// start benchmarking:
require 'Bench.php';
Bench::mark ('start');

// perform some logic here

Bench::mark ('notes...');

// perform some more logic

Bench::mark ('next marker');

// output the results:
Bench::mark (true);

?>