[ Index ]
 

Code source de PHP PEAR 1.4.5

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

title

Body

[fermer]

/Benchmark/ -> Profiler.php (sommaire)

(pas de description)

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

Définit 1 class

Benchmark_Profiler:: (11 méthodes):
  Benchmark_Profiler()
  _Benchmark_Profiler()
  getSectionInformations()
  getAllSectionsInformations()
  _getOutput()
  display()
  start()
  stop()
  enterSection()
  leaveSection()
  _getMicrotime()


Classe: Benchmark_Profiler  - X-Ref

Provides timing and profiling information.

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

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

$profiler = new Benchmark_Profiler(TRUE);

function myFunction() {
global $profiler;
$profiler->enterSection('myFunction');
//do something
$profiler->leaveSection('myFunction');
return;
}

//do something
myFunction();
//do more
?>
</code>

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

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

$profiler = new Benchmark_Profiler();

function myFunction() {
global $profiler;
$profiler->enterSection('myFunction');
//do something
$profiler->leaveSection('myFunction');
return;
}

$profiler->start();
//do something
myFunction();
//do more
$profiler->stop();
$profiler->display();
?>
</code>

Benchmark_Profiler($auto = FALSE)   X-Ref
Constructor, starts profiling recording


_Benchmark_Profiler()   X-Ref
Destructor, stops profiling recording


getSectionInformations($section = 'Global')   X-Ref
Returns profiling informations for a given section.

param: string $section
return: array

getAllSectionsInformations()   X-Ref
Returns profiling informations for all sections.

return: array

_getOutput($format)   X-Ref
Returns formatted profiling information.

param: string output format (auto, plain or html), default auto

display($format = 'auto')   X-Ref
Returns formatted profiling information.

param: string output format (auto, plain or html), default auto

start()   X-Ref
Enters "Global" section.


stop()   X-Ref
Leaves "Global" section.


enterSection($name)   X-Ref
Enters code section.

param: string  name of the code section

leaveSection($name)   X-Ref
Leaves code section.

param: string  name of the marker to be set

_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