More accurate memory usage in debug toolbar.

This commit is contained in:
Lonnie Ezell 2016-02-02 10:53:32 -06:00
parent cb999781a6
commit 307b40c9a5
3 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,8 @@
<?php
// Used by the debug toolbar. Do not remove.
$startMemory = memory_get_usage();
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT

View File

@ -52,8 +52,6 @@
define('CI_VERSION', '4.0-dev');
$startMemory = memory_get_usage(true);
/*
* ------------------------------------------------------
* Load the framework constants

View File

@ -36,7 +36,7 @@ class Toolbar
global $totalTime, $startMemory, $request, $response;
$totalTime = $totalTime * 1000;
$totalMemory = number_format(round(memory_get_peak_usage(true) / 1048576, 4), 3);
$totalMemory = number_format((memory_get_peak_usage() - $startMemory) / 1048576, 3);
ob_start();
include(dirname(__FILE__).'/Toolbar/View/toolbar.tpl.php');