<?php

//$Page['Authenticate'] = true;

require("include/common.php");

//trace();

require("include/header.php");

function f1()
{
	$s = "";
	for ($i = 0; $i < 1000000; $i++)
	{
		$s .= Q($i);
	}
	return $s;
}

function f2()
{
	$s = "";
	for ($i = 0; $i < 1000000; $i++)
	{
		$s .= Q($i);
	}
	return $s;
}

try {
	// TODO: How to set action and proper views in easy and readable form for the whole controller page?
	
	switch ($view)
	{
		default:
			
			tablebegin();
			
			$hero = new \Game\Hero();
			$hero->name = "Han Solo";
			$ability = new \Game\Hero\Ability();
			$ability->name = "anarchist";
			
			echo $hero->toString() . " + " . $ability->name;
	
			echo "<pre>";
			echo \Core\Benchmark::profile('f1', 50);
			echo "<br>";
			echo \Core\Benchmark::profile('f2', 50);
			echo "</pre>";
			
			tableend();
			
			break;
	}
}
catch (Exception $x)
{
	$Log->write($x->getMessage(), "engine");
}

require("include/footer.php");
