Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ancat/benchmarky

Simple benchmarking in PHP using keys to manage multiple timers
https://github.com/ancat/benchmarky

Last synced: about 2 months ago
JSON representation

Simple benchmarking in PHP using keys to manage multiple timers

Awesome Lists containing this project

README

        

Benchmarky
==========

Benchmarky is a small static class that makes benchmarking multiple
operations at the same time really easy. Most benchmarking classes
require creating some type of benchmarking object per each operation
you would like to keep track of. Not with benchmarky!

It has a cool name, too!

The general idea is each operation being benchmarked has its own key.
Timer organizes the keys on its own, so all you have to do is start
and stop the Timer, just using the key name.

This produces the following output:

Results for md5: 5000 tests; Max: 5.793571472168E-5; Min: 2.8610229492188E-6; Avg: 3.762674331665E-6; Total: 0.018813371658325
Results for sha1: 5000 tests; Max: 0.00011992454528809; Min: 2.8610229492188E-6; Avg: 4.1135787963867E-6; Total: 0.020567893981934

The results are all available in Timer::$results, so you can display the data as you see fit.