Browse Source

More precise page generation time

pull/457/head
danpros 4 years ago
parent
commit
e06296cc61
2 changed files with 3 additions and 10 deletions
  1. +1
    -1
      README.md
  2. +2
    -9
      system/includes/dispatch.php

+ 1
- 1
README.md View File

@ -40,7 +40,7 @@ Features
- User Roles
- Online Backup
- File Caching
- Auto Update
- Online Update
- Post Draft
- i18n
- Menu builder


+ 2
- 9
system/includes/dispatch.php View File

@ -351,16 +351,9 @@ function render($view, $locals = null, $layout = null)
header('Content-type: text/html; charset=utf-8');
if (config('generation.time') == 'true') {
ob_start();
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
require $layout;
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
$time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
$total_time = round($time, 4);
echo "\n" . '<!-- Dynamic page generated in '.$total_time.' seconds. -->';
} else {
ob_start();


Loading…
Cancel
Save