summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-30 08:39:11 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-30 08:39:11 +1000
commit343803afb9de3b27ba44d9594b6770f9c84d2e54 (patch)
tree95e429f5ab6875f5ce41e54702ff94aa357d5d9b /inc/template.php
parent8921eb9c1a43e13e096fe72850d75dcf2974483f (diff)
More $config['debug'] improvements to time-related stuff
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/template.php b/inc/template.php
index 6d417631..d9e1c386 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -46,8 +46,8 @@ 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';
+ $debug['time']['total'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms';
+ $debug['time']['init'] = '~' . round(($debug['start_debug'] - $debug['start']) * 1000, 2) . 'ms';
unset($debug['start']);
unset($debug['start_debug']);
}
@@ -55,6 +55,8 @@ function Element($templateFile, array $options) {
$debug['build_pages'] = $build_pages;
$debug['included'] = get_included_files();
$debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB';
+ $debug['time']['db_queries'] = '~' . round($debug['time']['db_queries'] * 1000, 2) . 'ms';
+ $debug['time']['exec'] = '~' . round($debug['time']['exec'] * 1000, 2) . 'ms';
$options['body'] .=
'<h3>Debug</h3><pre style="white-space: pre-wrap;font-size: 10px;">' .
str_replace("\n", '<br/>', utf8tohtml(print_r($debug, true))) .