<?php
#-------------------------------------------------------------------------
# Project [3dii]
# Version: [3dii IPad]  Alan Ryan www.codecrunchers.ie
# 5:13:43 PM -  Nov 3, 2010

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
#-------------------------------------------------------------------------


if(defined('DEBUG') && DEBUG == "ON") {
	ini_set("error_reporting", E_ALL);
	ini_set("display_errors", "On");
	ini_set("display_startup_errors", "On");
}

$starttime  = $endtime   = 0;

function methodStart(){
	global $starttime;

	if(defined('DEBUG') && DEBUG == "ON") {
		$starttime = microtime();
		$startarray = explode(" ", $starttime);
		$starttime = $startarray[1] + $startarray[0];
	}
}

function methodEnd($method_name = ""){
	global $starttime;

	if(defined('DEBUG') && DEBUG == "ON") {
		$endtime = microtime();
		$endarray = explode(" ", $endtime);
		$endtime = $endarray[1] + $endarray[0];
		$totaltime = $endtime - $starttime;
		$totaltime = round($totaltime,5);
		echo "$method_name executed in $totaltime seconds.";

	}
}


function debug_print($obj){	
	if(defined('DEBUG') && DEBUG == "ON") {
	print "<pre>";
		print_r($obj);
	print "</pre>";
	
	}
	
}



?>