diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/standard/tests/general_functions/getrusage_basic.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/standard/tests/general_functions/getrusage_basic.phpt')
-rw-r--r-- | ext/standard/tests/general_functions/getrusage_basic.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/standard/tests/general_functions/getrusage_basic.phpt b/ext/standard/tests/general_functions/getrusage_basic.phpt new file mode 100644 index 0000000..c9b3459 --- /dev/null +++ b/ext/standard/tests/general_functions/getrusage_basic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test getrusage() function: basic test +--SKIPIF-- +<?php +if( substr(PHP_OS, 0, 3) == "WIN" ) + die("skip.. Do not run on Windows"); +?> +--FILE-- +<?php +/* Prototype : array getrusage ([ int $who ] ) + * Description: Gets the current resource usages + * Source code: ext/standard/microtime.c + * Alias to functions: + */ + +echo "Simple testcase for getrusage() function\n"; + +$dat = getrusage(); + +if (!is_array($dat)) { + echo "TEST FAILED : getrusage shoudl return an array\n"; +} + +// echo the fields which are common to all platforms +echo "User time used (seconds) " . $dat["ru_utime.tv_sec"] . "\n"; +echo "User time used (microseconds) " . $dat["ru_utime.tv_usec"] . "\n"; +?> +===DONE=== +--EXPECTF-- +Simple testcase for getrusage() function +User time used (seconds) %d +User time used (microseconds) %d +===DONE=== |