How to measure execution times of PHP scripts?

Technology CommunityCategory: PHPHow to measure execution times of PHP scripts?
VietMX Staff asked 3 years ago
Problem

I want to know how many milliseconds a PHP while-loop takes to execute. Could you help me?

You can use the microtime function for this.

Consider:

$start = microtime(true);
while (...) {

}
$time_elapsed_secs = microtime(true) - $start;