How to measure execution times of PHP scripts? Technology Community › Category: PHP › How to measure execution times of PHP scripts? 0 Vote Up Vote Down VietMX Staff asked 4 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;