(PHP 4, PHP 5, PHP 7)
getrusage — ��ȡ��ǰ��Դʹ��״��
$who = 0
] ) : array���� getrusage(2) �Ľӿڡ��������˵�����ϵͳ�����ݡ�
who
��� who �� 1��getrusage ��ʹ��
RUSAGE_CHILDREN �����á�
������һ������ϵͳ�������ݵĹ������顣������Ŀ����ͨ���ĵ����ֶε����������ʡ�
Example #1 getrusage() ����
<?php
$dat = getrusage();
echo $dat["ru_nswap"]; // number of swaps
echo $dat["ru_majflt"]; // number of page faults
echo $dat["ru_utime.tv_sec"]; // user time used (seconds)
echo $dat["ru_utime.tv_usec"]; // user time used (microseconds)
?>
| �汾 | ˵�� |
|---|---|
| 7.0.0 | �˺������ڿ�ʼ֧�� Windows�� |
Note:
�� Windows �� getrusage() ���᷵���������ͣ�
- "ru_stime.tv_sec"
- "ru_stime.tv_usec"
- "ru_utime.tv_sec"
- "ru_utime.tv_usec"
- "ru_majflt" (only if
whoisRUSAGE_SELF)- "ru_maxrss" (only if
whoisRUSAGE_SELF)If getrusage() is called with
whoset to 1 (RUSAGE_CHILDREN), then resource usage for threads are collected (meaning that internally the function is called withRUSAGE_THREAD).
Note:
�� BeOS 2000�����᷵���������ͣ�
- "ru_stime.tv_sec"
- "ru_stime.tv_usec"
- "ru_utime.tv_sec"
- "ru_utime.tv_usec"