<?

class timer {
var $ttt;

    function timer()
    {
        $this->ttt=$this->_getmicrotime();
    }

    function _getmicrotime()
    {
        list($usec, $sec) = explode(" ",microtime());
        return ((float)$usec + (float)$sec);
    }

    function elapsed()
    {
        $ddd = $this->_getmicrotime();
        $elapsed = $ddd-$this->ttt;
		/*
        echo "<div style=\"border:1px solid silver;background-color:whitesmoke;padding:10px;width:100px;height:30px;\">Elapsed time: $elapsed seconds</div>";
		*/
		return $elapsed;
    }
}
?>