I am trying to get the execution time of an operation that runs iteratively, but when trying to compare, I get 0 seconds.
$startedAt = time();
for ($i = 0; $i < 10000; $i++) {
// Solo como código demostrativo.
preg_match('/^0{3}\b/', $number);
}
$finishedAt = time();
echo 'Tiempo: ' . ($finishedAt - $startedAt);
Searching in php.net I don't find an alternative function, is there another solution?
You can do it with microtime