[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Benchmark/ -> Timer.php (sommaire)

(pas de description)

Poids: 319 lignes (10 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 1 fichier
 PEAR.php

Définit 1 class

Benchmark_Timer:: (10 méthodes):
  Benchmark_Timer()
  _Benchmark_Timer()
  start()
  stop()
  setMarker()
  timeElapsed()
  getProfiling()
  getOutput()
  display()
  _getMicrotime()


Classe: Benchmark_Timer  - X-Ref

Provides timing and profiling information.

Example 1: Automatic profiling start, stop, and output.

<code>
<?php
require_once 'Benchmark/Timer.php';

$timer = new Benchmark_Timer(TRUE);
$timer->setMarker('Marker 1');
?>
</code>

Example 2: Manual profiling start, stop, and output.

<code>
<?php
require_once 'Benchmark/Timer.php';

$timer = new Benchmark_Timer();
$timer->start();
$timer->setMarker('Marker 1');
$timer->stop();

$timer->display(); // to output html formated
// AND/OR :
$profiling = $timer->getProfiling(); // get the profiler info as an associative array
?>
</code>

Benchmark_Timer($auto = FALSE)   X-Ref
Constructor.

param: boolean $auto

_Benchmark_Timer()   X-Ref
Destructor.


start()   X-Ref
Set "Start" marker.


stop()   X-Ref
Set "Stop" marker.


setMarker($name)   X-Ref
Set marker.

param: string  $name Name of the marker to be set.

timeElapsed($start = 'Start', $end = 'Stop')   X-Ref
Returns the time elapsed betweens two markers.

param: string  $start        start marker, defaults to "Start"
param: string  $end          end marker, defaults to "Stop"
return: double  $time_elapsed time elapsed between $start and $end

getProfiling()   X-Ref
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

return: array

getOutput($showTotal = FALSE, $format = 'auto')   X-Ref
Return formatted profiling information.

param: boolean  $showTotal   Optionnaly includes total in output, default no
param: string  $format   output format (auto, plain or html), default auto
return: string

display($showTotal = FALSE, $format = 'auto')   X-Ref
Prints the information returned by getOutput().

param: boolean  $showTotal   Optionnaly includes total in output, default no
param: string  $format   output format (auto, plain or html), default auto

_getMicrotime()   X-Ref
Wrapper for microtime().

return: float



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7