]> granicus.if.org Git - php/commitdiff
more accurate timing function.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 14 Jun 2005 23:59:29 +0000 (23:59 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 14 Jun 2005 23:59:29 +0000 (23:59 +0000)
Zend/bench.php

index c45fe40bcc942a1bef896a5073438edb3e631e21..848a099ea564cf02c9c3c8950c063e3016326d89 100644 (file)
@@ -336,10 +336,10 @@ function strcat($n) {
 /*****/
 
 function getmicrotime()
-{ 
-  list($usec, $sec) = explode(" ",microtime()); 
-  return ((float)$usec + (float)$sec); 
-} 
+{
+  $t = gettimeofday();
+  return ($t['sec'] + $t['usec'] / 1000000);
+}
 
 function start_test()
 {