Files
majestic/util/profiler/CommandProfiler.php

44 lines
789 B
PHP
Raw Normal View History

<?php
/**
* @copyright NetMonsters <team@netmonsters.ru>
* @link http://netmonsters.ru
* @package Majestic
* @subpackage util
* @since 2010-03-09
*/
2011-07-29 13:05:23 +04:00
class CommandProfiler
{
2011-07-29 13:05:23 +04:00
protected $type;
protected $command = '';
protected $start = null;
protected $end = null;
2011-07-29 13:05:23 +04:00
public function __construct($type, $command)
{
2011-07-29 13:05:23 +04:00
$this->type = $type;
$this->command = $command;
$this->start = microtime(true);
}
public function end()
{
$this->end = microtime(true);
}
2011-07-29 13:05:23 +04:00
public function getCommand()
{
2011-07-29 13:05:23 +04:00
return $this->command;
}
public function getType()
{
return $this->type;
}
public function getElapsed()
{
return $this->end - $this->start;
}
}