- getrusage: documentation ( source)
<?php
$dat = getrusage();
echo $dat["ru_nswap"]; // number of swaps
echo "\n";
echo $dat["ru_majflt"]; // number of page faults
echo "\n";
echo $dat["ru_utime.tv_sec"]; // user time used (seconds)
echo "\n";
echo $dat["ru_utime.tv_usec"];
echo "\n";