Skip to content

Instantly share code, notes, and snippets.

@Mark-H
Created September 21, 2012 12:01
Show Gist options
  • Save Mark-H/3761096 to your computer and use it in GitHub Desktop.
Save Mark-H/3761096 to your computer and use it in GitHub Desktop.
Simple snippet to dump profiler data on screen
<?php
if ($modx->profiler) {
echo '<pre>';
foreach ($modx->profiler->timing[modProfiler::VIEW_CHRONOLOGICAL] as $node) {
echo $node['namespace'] . '-' . $node['action'] . ' | Start: ' . $node['start'] . ' | Duration: ' . number_format($node['duration'],7) . "s\n";
}
echo '</pre>';
}
@alroniks
Copy link

Mark, how I can install or enable modx->profiler for using this snippet?

@Mark-H
Copy link
Author

Mark-H commented Apr 11, 2013

It's a separate branch on my Github fork: https://github.com/Mark-H/revolution/tree/feature-profiler Would be better to add it as an extension package but I didn't see the possibility to do that, while also adding profiling calls to core functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment