<p class="marginTop" id="benchmark"><small>Execution time: {@$__wcf->getBenchmark()->getExecutionTime()}s ({#($__wcf->getBenchmark()->getExecutionTime()-$__wcf->getBenchmark()->getQueryExecutionTime())/$__wcf->getBenchmark()->getExecutionTime()*100}% PHP, {#$__wcf->getBenchmark()->getQueryExecutionTime()/$__wcf->getBenchmark()->getExecutionTime()*100}% SQL) | SQL queries: {#$__wcf->getBenchmark()->getQueryCount()} | Memory-Usage: {$__wcf->getBenchmark()->getMemoryUsage()}</small></p>
{if ENABLE_DEBUG_MODE}
+ <script type="text/javascript">
+ //<![CDATA[
+ $(function() {
+ $('#benchmarkDetails > li > span').click(function() {
+ $(this).parent().children('pre').toggle();
+ });
+ });
+ //]]>
+ </script>
<ul id="benchmarkDetails" style="display: none;">
- {foreach from=$__wcf->getBenchmark()->getItems() item=item}
- <li style="margin-bottom: 8px;"{if $item.use >= 0.01} class="hot"{/if}>{if $item.type == 1}(SQL Query) {/if}{$item.text}<br /><small style="font-size: .85em">Execution time: {@$item.use}s</small></li>
+ {foreach from=$__wcf->getBenchmark()->getItems() key=benchmarkIndex item=item}
+ <li id="benchmarkItem{@$benchmarkIndex}" style="margin-bottom: 8px;"{if $item.use >= 0.01} class="hot"{/if}>
+ <span>{if $item.type == 1}(SQL Query) {/if}{$item.text}</span><br />
+ <small style="font-size: .85em">Execution time: {@$item.use}s</small>
+
+ <pre style="display: none">{foreach from=$item.trace key=traceNo item=traceItem}#{#$traceNo} {if !$traceItem.class|empty}{$traceItem.class}{$traceItem.type}{else}{$traceItem.file}: {/if}{$traceItem.function}() {if !$traceItem.line|empty}(line {#$traceItem.line}){/if}
+{/foreach}</pre>
+
+ </li>
{/foreach}
</ul>
$this->items[$newIndex]['type'] = $type;
$this->items[$newIndex]['before'] = self::getMicrotime();
$this->items[$newIndex]['start'] = self::compareMicrotimes($this->startTime, $this->items[$newIndex]['before']);
+ $this->items[$newIndex]['trace'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
return $newIndex;
}