<?php
/**
* ÐлаÑÑ Ð´Ð»Ñ Ð¸Ð·Ð¼ÐµÑÐµÐ½Ð¸Ñ Ð¾ÑÑезков вÑемени
*
* @package webacula
* @author Yuri Timofeev <hide@address.com>
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU Public License
*/
class MyClass_GaugeTime
{
protected $start_time;
public function __construct ()
{
$this->start_time = $this->getTime();
}
/**
* @return возвÑаÑÐ°ÐµÑ ÑекÑÑее вÑемÑ
*/
function getTime ()
{
$ptime = explode(' ', microtime());
$result = $ptime[1] + $ptime[0];
return $result;
}
/**
* @return возвÑаÑÐ°ÐµÑ ÑазниÑÑ Ð²Ð¾ вÑемени
*/
function diffTime ()
{
$end_time = $this->getTime();
$diff_time = number_format($end_time - $this->start_time, 5);
return $diff_time;
}
}