Annotation of embedaddon/php/ext/standard/tests/misc/time_nanosleep_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: time_nanosleep — Delay for a number of seconds and nanoseconds
! 3: --SKIPIF--
! 4: <?php if (!function_exists('time_nanosleep')) die("skip");
! 5: if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
! 6: ?>
! 7: --CREDITS--
! 8: Àlex Corretgé - alex@corretge.cat
! 9: --FILE--
! 10: <?php
! 11: $nano = time_nanosleep(2, 100000);
! 12:
! 13: if ($nano === true) {
! 14: echo "Slept for 2 seconds, 100 milliseconds.\n";
! 15: } elseif ($nano === false) {
! 16: echo "Sleeping failed.\n";
! 17: } elseif (is_array($nano)) {
! 18: $seconds = $nano['seconds'];
! 19: $nanoseconds = $nano['nanoseconds'];
! 20: echo "Interrupted by a signal.\n";
! 21: echo "Time remaining: $seconds seconds, $nanoseconds nanoseconds.";
! 22: }
! 23: ?>
! 24: --EXPECT--
! 25: Slept for 2 seconds, 100 milliseconds.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>