public function __construct($connection = null) { $config = Config::get('profiler'); if ($config['useForensics'] != true) { return; } if ($connection instanceof Connection) { $this->connection = $connection; } else { if ($config['withDatabase'] == true) { $this->connection = DB::connection(); } } // Setup the View path. $this->viewPath = realpath(__DIR__) . DS . 'Views' . DS . 'Profiler.php'; // Setup the Start Time. $this->startTime = Request::server('REQUEST_TIME_FLOAT'); }
protected function getElapsedTime() { $timestamp = microtime(true); $requestTime = Request::server('REQUEST_TIME_FLOAT'); return $timestamp - $requestTime; }