Since PHP 7.3 the hrtime function should be used for any timing.
$start = hrtime(true);
// execute...
$end = hrtime(true);
echo ($end - $start); // Nanoseconds
echo ($end - $start) / 1000000000; // Seconds
The mentioned microtime function relies on the system clock. Which can be modified e.g. by the ntpd program on ubuntu or just the sysadmin.