Просмотр файла include/stat.php

Размер файла: 551B
<?
$counter_mysql = 0;
$timer_mysql = 0;
$timer=microtime (true);
	
function count_query($query) 
	{
		global $counter_mysql;
		global $timer_mysql;

		$counter_mysql++;
		$start=microtime (true);
		$result=mysql_query($query);
		$timer_mysql+=microtime (true)-$start;
		return $result;
	}


	function result() 
	{
		global $counter_mysql;
		global $timer_mysql;
		global $timer;

		$now=microtime (true)- $timer;
		echo "".round($now,4)."<br>";
		echo "Запросов: ".$counter_mysql."<br>";
		echo "Время запросов: ".round($timer_mysql,4)."<br>";
		}
?>