php-src/ext/standard/tests/time/001.phpt

35 lines
664 B
Plaintext
Raw Normal View History

2001-02-04 16:56:59 +00:00
--TEST--
microtime() function
--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;
$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++) {
list($micro,$time)=explode(" ",microtime());
if ($time > $last_t || ($time == $last_t && $micro >= $last_m)) {
$passed++;
2002-11-15 14:46:52 +00:00
} else if ($failed++ <=10) {
$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
}
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
Failed: 0