<?php
/**
 * @copyright NetMonsters <team@netmonsters.ru>
 * @link http://netmonsters.ru
 * @package Majestic
 * @subpackage util
 * @since 2010-03-09
 * @version SVN: $Id$
 * @filesource $URL$
 */

class QueryProfiler
{
    
    protected $query = '';
    protected $start = null;
    protected $end   = null;
    
    public function __construct($query)
    {
        $this->query = $query;
        $this->start = microtime(true);
    }
    
    public function end()
    {
        $this->end = microtime(true);
    }
    
    public function getQuery()
    {
        return $this->query;
    }
    
    public function getElapsed()
    {
        return $this->end - $this->start;
    }
}