Skip to content

Commit 2d92309

Browse files
author
Ilia Alshanetsky
committed
more accurate timing function.
1 parent 9392a1c commit 2d92309

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Zend/bench.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,10 @@ function strcat($n) {
336336
/*****/
337337

338338
function getmicrotime()
339-
{
340-
list($usec, $sec) = explode(" ",microtime());
341-
return ((float)$usec + (float)$sec);
342-
}
339+
{
340+
$t = gettimeofday();
341+
return ($t['sec'] + $t['usec'] / 1000000);
342+
}
343343

344344
function start_test()
345345
{

0 commit comments

Comments
 (0)