PHP Rendertime

per Klasse
Warnung! Spoiler!

Php Code:

class RenderTime
{
	var $STARTTIME=0;
	var $ENDTIME=0;
	var $gentime=0;
	
	function stop()
	{
		# BEENDE LAUFZEIT MESSUNG #
		$this->ENDTIME = microtime(true);
		$gentime = $this->ENDTIME  - $this->STARTTIME;
	}
	 
	
	function __construct()
	{
		$this->STARTTIME = microtime(true);
	}
	
	
}


# BEISPIEL mit Klasse
#ANFANG des Scripts:
$RTIMER = new RenderTime();
/*hier kommt dein Script mit blablabala
und noch mehr bla */
#ENDE des Scripts:
$RTIMER->stop();
#RENDERTIME: $RTIMER->gentime;
 



ohne klasse
Php Code:

##### AUFRUF AM ANFANG
$STARTTIME = microtime(true);


#### AUFRUF AM ENDE
$ENDTIME = microtime(true);
$RENDERTIME = $ENDTIME - $STARTTIME;