Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/Benchmark/Timer.php
PEAR Repository -

Benchmark_Timer

Benchmark_Timer

Benchmark::Timer

 

public class Benchmark_Timer

Benchmark::Timer

Purpose:

Timing Script Execution, Generating Profiling Information

Example:

$timer = new Benchmark_Timer;

$timer->start();
$timer->set_marker( "Marker 1" );
$timer->stop();

$profiling = $timer->get_profiling();

AuthorsSebastian Bergmann <sb@phpOpenTracker.de>
Version$Revision: 1.3 $

 
Direct known subclasses: Benchmark_Iterate

Public Method Summary

void

start()

Set "Start" marker.
void

stop()

Set "Stop" marker.
void

set_marker(string $name)

Set marker.
double

time_elapsed([ string $start, string $end ])

Returns the time elapsed betweens two markers.
array

get_profiling()

Returns profiling information.

Public Field Summary

array

$markers

Contains the markers

Public Method Details

start

public void start( )

  Set "Start" marker.

Returns void

See Also set_marker(), stop()

stop

public void stop( )

  Set "Stop" marker.

Returns void

See Also set_marker(), start()

set_marker

public void set_marker( string $name )

  Set marker.

Parameter
string $name
name of the marker to be set
Returns void

See Also start(), stop()

time_elapsed

public double time_elapsed( [ string $start, string $end ] )

  Returns the time elapsed betweens two markers.

Parameter
string $start = >>"Start"<<
start marker, defaults to "Start"
string $end = >>"Stop"<<
end marker, defaults to "Stop"
Returns double $time_elapsed

time elapsed between $start and $end


get_profiling

public array get_profiling( )

  Returns profiling information.

$profiling[ x ][ "name" ] = name of marker x
$profiling[ x ][ "time" ] = time index of marker x
$profiling[ x ][ "diff" ] = execution time from marker x-1 to this marker x
$profiling[ x ][ "total" ] = total execution time up to marker x

Returns array $profiling


Public Field Details

$markers

public array $markers

>>array()<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta