From c0627c7a5e3bd343d0b33bf0b3a37639c5f33885 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 29 Feb 2016 22:47:02 +0100 Subject: Dropped unused benchmark script --- buildscripts/Benchmark/Iterate.php | 167 ------------------------------------- 1 file changed, 167 deletions(-) delete mode 100644 buildscripts/Benchmark/Iterate.php (limited to 'buildscripts/Benchmark/Iterate.php') diff --git a/buildscripts/Benchmark/Iterate.php b/buildscripts/Benchmark/Iterate.php deleted file mode 100644 index f09dcb76..00000000 --- a/buildscripts/Benchmark/Iterate.php +++ /dev/null @@ -1,167 +0,0 @@ -. | -// +------------------------------------------------------------------------+ -// | This source file is subject to the New BSD license, That is bundled | -// | with this package in the file LICENSE, and is available through | -// | the world-wide-web at | -// | http://www.opensource.org/licenses/bsd-license.php | -// | If you did not receive a copy of the new BSDlicense and are unable | -// | to obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +------------------------------------------------------------------------+ -// -// $Id: Iterate.php,v 1.12 2006/02/17 16:29:44 toggg Exp $ -// - -require_once 'Benchmark/Timer.php'; - -/** - * Provides timing and profiling information. - * - * Example 1 - * - * - * '; - * } - * - * $benchmark->run(100, 'foo', 'test'); - * $result = $benchmark->get(); - * ?> - * - * - * Example 2 - * - * - * '; - * } - * } - * - * $benchmark->run(100, 'myclass::foo', 'test'); - * $result = $benchmark->get(); - * ?> - * - * - * Example 3 - * - * - * '; - * } - * } - * - * $o = new MyClass(); - * - * $benchmark->run(100, 'o->foo', 'test'); - * $result = $benchmark->get(); - * ?> - * - * - * @author Sebastian Bergmann - * @copyright Copyright © 2002-2005 Sebastian Bergmann - * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0 - * @category Benchmarking - * @package Benchmark - */ -class Benchmark_Iterate extends Benchmark_Timer { - /** - * Benchmarks a function or method. - * - * @access public - */ - function run() { - $arguments = func_get_args(); - $iterations = array_shift($arguments); - $function_name = array_shift($arguments); - - if (strstr($function_name, '::')) { - $function_name = explode('::', $function_name); - $objectmethod = $function_name[1]; - } - - if (strstr($function_name, '->')) { - $function_name = explode('->', $function_name); - $objectname = $function_name[0]; - - $object = $GLOBALS[$objectname]; - $objectmethod = $function_name[1]; - - for ($i = 1; $i <= $iterations; $i++) { - $this->setMarker('start_' . $i); - call_user_func_array(array($object, $function_name[1]), $arguments); - $this->setMarker('end_' . $i); - } - - return(0); - } - - for ($i = 1; $i <= $iterations; $i++) { - $this->setMarker('start_' . $i); - call_user_func_array($function_name, $arguments); - $this->setMarker('end_' . $i); - } - } - - /** - * Returns benchmark result. - * - * $result[x ] = execution time of iteration x - * $result['mean' ] = mean execution time - * $result['iterations'] = number of iterations - * - * @return array - * @access public - */ - function get($simple_output = false) { - $result = array(); - $total = 0; - - $iterations = count($this->markers)/2; - - for ($i = 1; $i <= $iterations; $i++) { - $time = $this->timeElapsed('start_'.$i , 'end_'.$i); - - if (extension_loaded('bcmath')) { - $total = bcadd($total, $time, 6); - } else { - $total = $total + $time; - } - - if (!$simple_output) { - $result[$i] = $time; - } - } - - if (extension_loaded('bcmath')) { - $result['mean'] = bcdiv($total, $iterations, 6); - } else { - $result['mean'] = $total / $iterations; - } - - $result['iterations'] = $iterations; - - return $result; - } -} -- cgit v1.2.3