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

Class: Benchmark_Iterate

Source Location: /Benchmark-1.2.9/Benchmark/Iterate.php

Class Overview

PEAR
   |
   --Benchmark_Timer
      |
      --Benchmark_Iterate

Provides timing and profiling information.


Author(s):

Copyright:

  • 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>

Methods


Inherited Variables

Inherited Methods

Class: Benchmark_Timer

Benchmark_Timer::Benchmark_Timer()
Constructor.
Benchmark_Timer::close()
Close method. Stop timer and display output.
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 95]
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 148]

array get( [bool $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

Parameters:

bool   $simple_output   —  Show just the total

[ Top ]

run   [line 104]

void run( )

Benchmarks a function or method.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:46:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.