Benchmark
[ class tree: Benchmark ] [ index: Benchmark ] [ all elements ]

Class: Benchmark_Iterate

Source Location: /Benchmark-1.2.3/Iterate.php

Class Overview

PEAR
   |
   --Benchmark_Timer
      |
      --Benchmark_Iterate

Provides timing and profiling information.


Author(s):

Copyright:

  • Copyright &copy; 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>

Methods


Inherited Variables

Inherited Methods

Class: Benchmark_Timer

Benchmark_Timer::Benchmark_Timer()
Constructor.
Benchmark_Timer::display()
Prints the information returned by getOutput().
Benchmark_Timer::getOutput()
Return formatted profiling information.
Benchmark_Timer::getProfiling()
Returns profiling information.
Benchmark_Timer::setMarker()
Set marker.
Benchmark_Timer::start()
Set "Start" marker.
Benchmark_Timer::stop()
Set "Stop" marker.
Benchmark_Timer::timeElapsed()
Returns the time elapsed betweens two markers.

Class Details

[line 86]
Provides timing and profiling information.

Example 1


1 <?php
2 require_once 'Benchmark/Iterate.php';
3
4 $benchmark = new Benchmark_Iterate;
5
6 function foo($string) {
7 print $string . '<br>';
8 }
9
10 $benchmark->run(100, 'foo', 'test');
11 $result = $benchmark->get();
12 ?>

Example 2


1 <?php
2 require_once 'Benchmark/Iterate.php';
3
4 $benchmark = new Benchmark_Iterate;
5
6 class MyClass {
7 function foo($string) {
8 print $string . '<br>';
9 }
10 }
11
12 $benchmark->run(100, 'myclass::foo', 'test');
13 $result = $benchmark->get();
14 ?>

Example 3


1 <?php
2 require_once 'Benchmark/Iterate.php';
3
4 $benchmark = new Benchmark_Iterate;
5
6 class MyClass {
7 function foo($string) {
8 print $string . '<br>';
9 }
10 }
11
12 $o = new MyClass();
13
14 $benchmark->run(100, 'o->foo', 'test');
15 $result = $benchmark->get();
16 ?>



[ Top ]


Method Detail

get   [line 135]

array get( [mixed $simple_output = false])

Returns benchmark result.

$result[x ] = execution time of iteration x $result['mean' ] = mean execution time $result['iterations'] = number of iterations

  • Access: public

[ Top ]

run   [line 92]

void run( )

Benchmarks a function or method.
  • Access: public

[ Top ]


Documentation generated on Sat, 11 Jun 2005 08:20:06 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.