2001-02-04 16:56:59 +00:00
|
|
|
--TEST--
|
|
|
|
microtime() function
|
2002-11-01 12:12:40 +00:00
|
|
|
--SKIPIF--
|
2003-05-23 20:51:49 +00:00
|
|
|
<?php
|
|
|
|
if (!function_exists('microtime')) die('skip microtime() not available');
|
|
|
|
die('warn system dependent');
|
|
|
|
?>
|
2001-02-04 16:56:59 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$passed = 0;
|
|
|
|
$failed = 0;
|
2002-11-01 12:12:40 +00:00
|
|
|
$last_m = 0;
|
|
|
|
$last_t = 0;
|
|
|
|
$result = '';
|
2001-08-18 16:47:02 +00:00
|
|
|
|
|
|
|
set_time_limit(0);
|
|
|
|
|
|
|
|
for ($i=1;$i<=100000;$i++) {
|
2002-11-01 12:12:40 +00:00
|
|
|
list($micro,$time)=explode(" ",microtime());
|
2004-07-23 21:53:16 +00:00
|
|
|
if ($time > $last_t || ($time == $last_t && $micro >= $last_m)) {
|
2002-11-01 12:12:40 +00:00
|
|
|
$passed++;
|
2002-11-15 14:46:52 +00:00
|
|
|
} else if ($failed++ <=10) {
|
2002-11-01 12:12:40 +00:00
|
|
|
$result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n";
|
|
|
|
}
|
|
|
|
$last_m = $micro;
|
|
|
|
$last_t = $time;
|
2001-08-18 16:47:02 +00:00
|
|
|
}
|
2002-11-01 12:12:40 +00:00
|
|
|
echo "Passed: $passed\n";
|
|
|
|
echo "Failed: $failed\n";
|
|
|
|
echo $result;
|
2001-02-04 16:56:59 +00:00
|
|
|
?>
|
2002-11-05 09:52:30 +00:00
|
|
|
--EXPECT--
|
|
|
|
Passed: 100000
|
2002-11-01 12:12:40 +00:00
|
|
|
Failed: 0
|