diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-29 08:30:21 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-29 08:30:21 +1000 |
| commit | 82577738072a833aa0ec8ed6e798d684d1abea1d (patch) | |
| tree | 6e97f8ab2d63f7df787053ac8ed5ab21d759d980 | |
| parent | 3fbd05173713f281fb89247f750ba2cad7ae6253 (diff) | |
$config['debug']: Show time initializing Tinyboard (before $debug was created)
| -rw-r--r-- | inc/functions.php | 1 | ||||
| -rw-r--r-- | inc/template.php | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php index 236e5199..ec37a617 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -85,6 +85,7 @@ function loadConfig() { if (!isset($debug)) { $debug = array('sql' => array(), 'exec' => array(), 'purge' => array(), 'cached' => array(), 'write' => array()); $debug['start'] = $microtime_start; + $debug['start_debug'] = microtime(true);; } } diff --git a/inc/template.php b/inc/template.php index ef688944..6f85e78b 100644 --- a/inc/template.php +++ b/inc/template.php @@ -47,7 +47,9 @@ function Element($templateFile, array $options) { if (isset($options['body']) && $config['debug']) { if (isset($debug['start'])) { $debug['time'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms'; + $debug['time (initialization)'] = '~' . round(($debug['start_debug'] - $debug['start']) * 1000, 2) . 'ms'; unset($debug['start']); + unset($debug['start_debug']); } $debug['included'] = get_included_files(); $debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB'; |
