diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-29 08:25:15 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-29 08:25:15 +1000 |
| commit | 3fbd05173713f281fb89247f750ba2cad7ae6253 (patch) | |
| tree | 975936168f699dea0b75ece1c20992d384e84966 /inc/functions.php | |
| parent | aa27a22f7ca12caa89e6ccddf7c399cb619ab49d (diff) | |
Record time started (in milliseconds) at the very beginning of inc/functions.php, even when $config['debug'] is disabled (because we can't tell, yet). Gets a more accurate time for page generation.
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php index c0cf47b1..236e5199 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -9,6 +9,8 @@ if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { exit; } +$microtime_start = microtime(true); + require_once 'inc/display.php'; require_once 'inc/template.php'; require_once 'inc/database.php'; @@ -24,7 +26,7 @@ mb_internal_encoding('UTF-8'); loadConfig(); function loadConfig() { - global $board, $config, $__ip, $debug, $__version; + global $board, $config, $__ip, $debug, $__version, $microtime_start; $error = function_exists('error') ? 'error' : 'basic_error_function_because_the_other_isnt_loaded_yet'; @@ -82,7 +84,7 @@ function loadConfig() { if ($config['debug']) { if (!isset($debug)) { $debug = array('sql' => array(), 'exec' => array(), 'purge' => array(), 'cached' => array(), 'write' => array()); - $debug['start'] = microtime(true); + $debug['start'] = $microtime_start; } } |
