Created
April 21, 2015 14:30
-
-
Save Renobird/e8b72491efea683a0bde to your computer and use it in GitHub Desktop.
ProcessWire Debug Timers
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 | |
/** | |
* Debug timers for Processwire when you can't enable debug mode | |
* | |
* https://processwire.com/talk/topic/7865-performance-drop-after-update-to-25/?p=76166 | |
* | |
* Courstesy of sforsman | |
* | |
*/ | |
$timer = "debug"; | |
Debug::timer($timer."1"); | |
// Phase 1 code | |
Debug::saveTimer($timer."1", "Phase 1"); | |
Debug::timer($timer."2"); | |
// Phase 2 code | |
Debug::saveTimer($timer."2", "Phase 2"); | |
Debug::timer($timer."3"); | |
// Phase 3 code | |
Debug::saveTimer($timer."3", "Phase 3"); | |
Debug::timer($timer."4"); | |
// Phase 4 code | |
Debug::saveTimer($timer."4", "Phase 4"); | |
file_put_contents(wire('config')->paths->logs."/timers.txt", var_export(Debug::getSavedTimers(),true), FILE_APPEND); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment