Patch for ext/standard/tests/time/001.phpt

From: Date: Sun, 17 Nov 2002 00:13:45 +0000
Subject: Patch for ext/standard/tests/time/001.phpt
Groups: php.dev php.dev 
Request: Send a blank email to php-dev+get-91155@lists.php.net to get a copy of this message
ext/standard/tests/time/001.phpt fails on Tru64, because the gettimeofday(2) C library function has not enough granularity in the standard configuration. <http://www2.tru64.org/pages.php?page=Tru64-FAQ-Programming> says that the clock's granularity is 1024 Hz normally, but can be increased by rebuilding the kernel. But that shouldn't be of any concern for PHP or for this test. Maybe a sentence about that should be added to the PHP manual, e.g. something like: "Although this function returns microseconds, this doesn't necessarily mean that your system library actually delivers such a high granularity." --- ext/standard/tests/time/001.phpt~ Fri Nov 15 10:25:59 2002 +++ ext/standard/tests/time/001.phpt Sat Nov 16 18:41:56 2002 @@ -14,7 +14,7 @@ for ($i=1;$i<=100000;$i++) { list($micro,$time)=explode(" ",microtime()); - if ($time > $last_t || ($time == $last_t && $micro > $last_m)) { + if ($time > $last_t || ($time == $last_t && $micro >= $last_m)) { $passed++; } else if ($failed++ <=10) { $result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n"; Regards... Michael

« previous php.dev (#91155) next »