Annotation of embedaddon/php/ext/standard/tests/general_functions/getrusage_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test getrusage() function: basic test
! 3: --SKIPIF--
! 4: <?php
! 5: if( substr(PHP_OS, 0, 3) == "WIN" )
! 6: die("skip.. Do not run on Windows");
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: /* Prototype : array getrusage ([ int $who ] )
! 11: * Description: Gets the current resource usages
! 12: * Source code: ext/standard/microtime.c
! 13: * Alias to functions:
! 14: */
! 15:
! 16: echo "Simple testcase for getrusage() function\n";
! 17:
! 18: $dat = getrusage();
! 19:
! 20: if (!is_array($dat)) {
! 21: echo "TEST FAILED : getrusage shoudl return an array\n";
! 22: }
! 23:
! 24: // echo the fields which are common to all platforms
! 25: echo "User time used (seconds) " . $dat["ru_utime.tv_sec"] . "\n";
! 26: echo "User time used (microseconds) " . $dat["ru_utime.tv_usec"] . "\n";
! 27: ?>
! 28: ===DONE===
! 29: --EXPECTF--
! 30: Simple testcase for getrusage() function
! 31: User time used (seconds) %d
! 32: User time used (microseconds) %d
! 33: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>