1,5 → 1,4 |
<?php |
|
/** Fichier de la classe Chronometre |
* |
* PHP Version 5 |
33,19 → 32,13 |
* @version Release: <package_version> |
* @link /doc/framework/ |
*/ |
class Chronometre |
{ |
class Chronometre { |
/*** Attributs : ***/ |
private $_temps = array (); |
private $_temps = array(); |
|
/** Constructeur : **/ |
public function __construct() |
{ |
$this->setTemps( |
array ( |
'depart' => microtime() |
) |
); |
public function __construct() { |
$this->setTemps(array('depart' => microtime())); |
} |
|
/** Accesseurs : |
54,13 → 47,14 |
* |
* @return int le temps écoulé |
*/ |
public function getTemps($cle = null) |
{ |
if (!is_null($cle)) { |
return $this->_temps[$cle]; |
public function getTemps($cle = null) { |
$temps = ''; |
if (!is_null($cle)) { |
$temps = $this->_temps[$cle]; |
} else { |
return $this->_temps; |
$temps = $this->_temps; |
} |
return $temps; |
} |
|
/** Setteur pour la variable temps |
69,8 → 63,7 |
* |
* @return null |
*/ |
public function setTemps($moment = array ()) |
{ |
public function setTemps($moment = array ()) { |
array_push($this->_temps, $moment); |
} |
|
98,7 → 91,7 |
* @param int $indentation le pas d'indentation. |
* @return string la chaine XHTML de mesure des temps. |
*/ |
function afficherChrono($indentation_origine = 8, $indentation = 4) { |
public function afficherChrono($indentation_origine = 8, $indentation = 4) { |
// Création du chrono de fin |
$GLOBALS['_SCRIPT_']['chrono']->setTemps(array ( |
'fin' => microtime() |
167,6 → 160,5 |
|
return $sortie; |
} |
|
} |
?> |