Created
September 21, 2012 12:01
-
-
Save Mark-H/3761096 to your computer and use it in GitHub Desktop.
Simple snippet to dump profiler data on screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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>'; | |
| } |
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
Mark, how I can install or enable modx->profiler for using this snippet?