Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Created March 1, 2013 04:11
Show Gist options
  • Save Fi1osof/5062419 to your computer and use it in GitHub Desktop.
Save Fi1osof/5062419 to your computer and use it in GitHub Desktop.
OnWebPageComplete stats plugin
<?php
$memory = round(memory_get_usage()/1024/1024, 4).' Mb';
print "<div>Memory: {$memory}</div>";
$totalTime= ($modx->getMicroTime() - $modx->startTime);
$queryTime= $modx->queryTime;
$queryTime= sprintf("%2.4f s", $queryTime);
$queries= isset ($modx->executedQueries) ? $modx->executedQueries : 0;
$totalTime= sprintf("%2.4f s", $totalTime);
$phpTime= $totalTime - $queryTime;
$phpTime= sprintf("%2.4f s", $phpTime);
print "<div>TotalTime: {$totalTime}</div>";
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment