posix_times Get process times php函数


posix_times

(PHP 4, PHP 5)

posix_timesGet process times

说明

array posix_times ( void )

Gets information about the current CPU usage.

返回值

Returns a hash of strings with information about the current process CPU usage. The indices of the hash are:

  • ticks - the number of clock ticks that have elapsed since reboot.
  • utime - user time used by the current process.
  • stime - system time used by the current process.
  • cutime - user time used by current process and children.
  • cstime - system time used by current process and children.

注释

Warning

This function isn't reliable to use, it may return negative values for high times.

范例

Example #1 Example use of posix_times()

<?php

$times 
posix_times();

print_r($times);
?>

以上例程的输出类似于:

Array
(
    [ticks] => 25814410
    [utime] => 1
    [stime] => 1
    [cutime] => 0
    [cstime] => 0
)



相关阅读:
posix_ttyname Determine terminal device name
posix_uname Get system name
pow 指数表达式
preg_filter 执行一个正则表达式搜索和替换
preg_grep 返回匹配模式的数组条目
preg_last_error 返回最后一个PCRE正则执行产生的错误代码
preg_match 执行一个正则表达式匹配
preg_match_all 执行一个全局正则表达式匹配
preg_quote 转义正则表达式字符
preg_replace 执行一个正则表达式的搜索和替换
preg_replace_callback 执行一个正则表达式搜索并且使用一个回调进行替换
preg_split 通过一个正则表达式分隔字符串
prev 将数组的内部指针倒回一位
print 输出字符串
快速导航

Copyright © 2016 phpStudy | 皖ICP备18014864号-4