diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /maintenance/benchmarks/benchmarkHooks.php | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'maintenance/benchmarks/benchmarkHooks.php')
-rw-r--r-- | maintenance/benchmarks/benchmarkHooks.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/maintenance/benchmarks/benchmarkHooks.php b/maintenance/benchmarks/benchmarkHooks.php index 3f5d6db0..fb25b9d9 100644 --- a/maintenance/benchmarks/benchmarkHooks.php +++ b/maintenance/benchmarks/benchmarkHooks.php @@ -29,7 +29,6 @@ require_once __DIR__ . '/Benchmarker.php'; * @ingroup Benchmark */ class BenchmarkHooks extends Benchmarker { - public function __construct() { parent::__construct(); $this->mDescription = 'Benchmark MediaWiki Hooks.'; @@ -46,13 +45,13 @@ class BenchmarkHooks extends Benchmarker { $time = $this->benchHooks(); $this->output( 'Loaded (one) hook: ' . $time . "\n" ); - for( $i = 0; $i < 9; $i++ ) { + for ( $i = 0; $i < 9; $i++ ) { $wgHooks['Test'][] = array( $this, 'test' ); } $time = $this->benchHooks(); $this->output( 'Loaded (ten) hook: ' . $time . "\n" ); - for( $i = 0; $i < 90; $i++ ) { + for ( $i = 0; $i < 90; $i++ ) { $wgHooks['Test'][] = array( $this, 'test' ); } $time = $this->benchHooks(); @@ -61,7 +60,7 @@ class BenchmarkHooks extends Benchmarker { } /** - * @param $trials int + * @param int $trials * @return string */ private function benchHooks( $trials = 10 ) { @@ -71,6 +70,7 @@ class BenchmarkHooks extends Benchmarker { } $delta = microtime( true ) - $start; $pertrial = $delta / $trials; + return sprintf( "Took %6.3fms", $pertrial * 1000 ); } |