How to test execution time of any part of the code in PHP. Basically you have to start counting microseconds before you code execution and stop after. This snippet shows how to do the counting.
Source code viewer
// Mark the starting point. // The code that needs to be tested should be executed. for ($i = 1; $i <= 10; $i++) { echo $i; } // When it's done, print the time difference.Programming Language: PHP