getrusage_basic.phpt 789 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test getrusage() function: basic test
  3. --SKIPIF--
  4. <?php if (!function_exists("getrusage")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. /* Prototype : array getrusage ([ int $who ] )
  8. * Description: Gets the current resource usages
  9. * Source code: ext/standard/microtime.c
  10. * Alias to functions:
  11. */
  12. echo "Simple testcase for getrusage() function\n";
  13. $dat = getrusage();
  14. if (!is_array($dat)) {
  15. echo "TEST FAILED : getrusage should return an array\n";
  16. }
  17. // echo the fields which are common to all platforms
  18. echo "User time used (seconds) " . $dat["ru_utime.tv_sec"] . "\n";
  19. echo "User time used (microseconds) " . $dat["ru_utime.tv_usec"] . "\n";
  20. ?>
  21. ===DONE===
  22. --EXPECTF--
  23. Simple testcase for getrusage() function
  24. User time used (seconds) %d
  25. User time used (microseconds) %d
  26. ===DONE===