static function Finish() { if (self::$finished) { return; } self::$finished = true; while (ob_get_level() > 3) { ob_end_flush(); } timer_start('Output Template'); utopia::OutputTemplate(); timer_end('Output Template'); if (isset($GLOBALS['timers']) && utopia::DebugMode()) { echo '<pre class="uDebug"><table>'; foreach ($GLOBALS['timers'] as $name => $info) { if (!is_array($info)) { continue; } $time = !array_key_exists('time_taken', $info) ? timer_end($name) : $info['time_taken']; $time = number_format($time, 2); echo '<tr><td style="vertical-align:top;border-top:1px solid black">' . $time . '</td><td style="vertical-align:top;border-top:1px solid black">' . $name . PHP_EOL . $info['info'] . '</td></tr>'; } echo '</table></pre>'; } header('X-Runtime: ' . number_format((microtime(true) - UCORE_START_TIME) * 1000) . 'ms'); die; }