Microtime Issues
Posted: Tue Nov 15, 2005 4:07 pm
We'll I'm making a benchmarker class but I'm having odd values on occasion from microtime. First of all I'm using php4.3
Now and then I will get values such as -0.943697 or -0.946591 (those two appeared in my last test)..
Any idea what could be causing this? Could it be my laptops computing abilities are not fast enough?
Code: Select all
function getTime() {
return microtime();
}
function getDifference($time1, $time2) {
$this->lastRun = $time2 - $time1;
return $this->lastRun;
}
function runCode() {
$time1 = $this->getTime();
exec($this->code);
$time2 = $this->getTime();
$this->addTime($this->getDifference($time1, $time2));
}Any idea what could be causing this? Could it be my laptops computing abilities are not fast enough?