mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
More accurate memory usage in debug toolbar.
This commit is contained in:
parent
cb999781a6
commit
307b40c9a5
@ -1,4 +1,8 @@
|
||||
<?php
|
||||
|
||||
// Used by the debug toolbar. Do not remove.
|
||||
$startMemory = memory_get_usage();
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
* APPLICATION ENVIRONMENT
|
||||
|
@ -52,8 +52,6 @@
|
||||
|
||||
define('CI_VERSION', '4.0-dev');
|
||||
|
||||
$startMemory = memory_get_usage(true);
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------
|
||||
* Load the framework constants
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user