0
I Use This!
Activity Not Available

Project Summary

The PHP5 benchmark class is a very simple way to do benchmarks in PHP 5.3, like this:

Here is the code to do that:

<?php
require('benchmark.class.php');

// 1st parameter: specifies whether the benchmark is started immediately or later (default: false)
// 2nd parameter: defines the iterations number for the Benchmark::loop() method (default: 1,000)
// 3rd parameter: defines the number of digits after the decimal point (default: 4)
$bench = new Benchmark(false, 10000, 3);

// Starts the benchmark
$bench->begin();

// Does a loop
$bench->loop(function() {
$array = array('foo', 'bar');
foreach($array as $value);
});

// Saves a flag
$bench->flag();

// Does a loop
$bench->loop(function() {
$array = array('foo', 'bar');
for($i = 0; $i < count($array); $i++);
});

// Stops the benchmark
// Parameter: specifies whether the results is shown immediately or later (default: false)
$bench->stop(false);

// Shows results
$bench->results();
?>

Tags

benchmark class php

In a Nutshell, php5-benchmark-class...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

GNU General Public License v3.0 or later
Permitted

Commercial Use

Modify

Distribute

Place Warranty

Use Patent Claims

Forbidden

Sub-License

Hold Liable

Required

Include Copyright

Include License

Distribute Original

Disclose Source

State Changes

Include Install Instructions

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    you can subscribe to e-mail newsletters to receive update from the Open Hub blog
  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    learn about Open Hub updates and features on the Open Hub blog

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis