adrianmak Posted February 26, 2016 Share Posted February 26, 2016 My client want that information on new pw's website. Something like "Processed in 0.08814 second(s), 3 queries, 1 file." on my page footer Link to comment Share on other sites More sharing options...
Jan Romero Posted February 26, 2016 Share Posted February 26, 2016 $timerkey = Debug::timer(); //do lots of things echo "Lots of things took " . Debug::timer($timerkey) . " seconds to do."; Note Ryan’s benchmarking tips here: https://processwire.com/blog/posts/processwire-3.0.6-brings-pages-upgrades-and-link-abstraction/#how-to-benchmark-pages 6 Link to comment Share on other sites More sharing options...
adrianmak Posted February 27, 2016 Author Share Posted February 27, 2016 $timerkey = Debug::timer(); //do lots of things echo "Lots of things took " . Debug::timer($timerkey) . " seconds to do."; Note Ryan’s benchmarking tips here: https://processwire.com/blog/posts/processwire-3.0.6-brings-pages-upgrades-and-link-abstraction/#how-to-benchmark-pages My pw's website is configured to us delay output method like $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; Should I put $timerkey = Debug::timer(); at the very beginning of _main.php and put echo xxxxxxxx . Debug::timer($timerkey) at the bottom and before </body> tag of _main.php ? Link to comment Share on other sites More sharing options...
horst Posted February 27, 2016 Share Posted February 27, 2016 It depends on what you want to measure. If you want to start measuring the time when the prepend file is parsed, thats the right solution. If you want measure the time from the beginning of execution, you also can start in the _init.php and end in the _main.php. As I said, it completly depends on what you want do. 2 Link to comment Share on other sites More sharing options...
Jugibur Posted February 27, 2016 Share Posted February 27, 2016 Is it for developing / internal use cases? Recently I found a module by user Adrian, called Tracy-Debugger: It shows you the processing time and *a lot* of other infos in a nice way, including PHP error reporting. If you don't know it, here's the thread: https://processwire.com/talk/topic/12208-tracy-debugger/ 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now