Skip to content

bamarni/php-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Usage

Simple benchmark example, between the date() function and new DateTime::format() :

<?php

require 'Benchmark.php';

$bench = new Benchmark;

$bench->addTarget('function', 'date', array('Y-m-d'));

$bench->addTarget('object', function() {
        $date = new DateTime;
        $date->format('Y-m-d');
    }
);

$result = $bench->execute();

/*
 * var_dump($result) :
 *
 *   array (size=2)
 *     'function' => string '100%' (length=4)
 *     'object'   => string '122%' (length=4) 
 */

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages