Rodrigo Chantes P Posted August 15, 2022 Share Posted August 15, 2022 (edited) I need to debug a module in my checkout page, i can't use xdebug in my server, because i don't have the authorization to do so, and i really want to know what part of my code is slowing my module, so i can determine if i can optimize it or not Edited February 10, 2023 by Rodrigo Chantes P (see edit history) Link to comment Share on other sites More sharing options...
Ali Samie Posted August 15, 2022 Share Posted August 15, 2022 I have done this in a server that I had no access but ftp and BO using prestashop logger. When it comes to time measurement you need to capture timestamp of just right now and store it in a variable. Then after some pieces of code you need to capture another timestamp and calculate the duration easily. For instance: // just before an specific part of code $startTime = time(); // any process that you need to measure // myProcess(); // after that process is finished $totalTime = time() - $startTime; PrestashopLogger::addLog("MyLogFlag --- total time was {$totalTime} second(s)"); Another thing is you can use this PrestashopLogger::addLog($message) any where you want and then check the logs in BO 1 Link to comment Share on other sites More sharing options...
Rodrigo Chantes P Posted August 15, 2022 Author Share Posted August 15, 2022 ok, this works wonders, thank you very much Link to comment Share on other sites More sharing options...
Ali Samie Posted August 16, 2022 Share Posted August 16, 2022 Please add [SOLVED] to the title of this post. thanks 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