[eluser]Unknown[/eluser]
Hello,
In the benchmark library the mark function uses microtime() to get the current time. But this only returns the actual time elapsed. If your server is running multiple tasks when you run your script you will get varying results.
You can address this by replacing the old Benchmark::mark method with the following code that uses getrusage() instead.
Code:
function mark($name)
{
$data = getrusage();
$this->marker[$name] = sprintf("%d.#d", $data['ru_utime.tv_sec'], $data['ru_utime.tv_usec']);
}