<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.posix.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.posix-times.php',
    1 => 'posix_times',
    2 => 'Get process times',
  ),
  'up' => 
  array (
    0 => 'ref.posix.php',
    1 => 'POSIX 函数',
  ),
  'prev' => 
  array (
    0 => 'function.posix-sysconf.php',
    1 => 'posix_sysconf',
  ),
  'next' => 
  array (
    0 => 'function.posix-ttyname.php',
    1 => 'posix_ttyname',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/posix/functions/posix-times.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.posix-times" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_times</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">posix_times</span> &mdash; <span class="dc-title">Get process times</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.posix-times-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_times</strong></span>(): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Gets information about the current CPU usage.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-times-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-times-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a hash of strings with information about the current
   process CPU usage. The indices of the hash are:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      ticks - the number of clock ticks that have elapsed since
      reboot.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      utime - user time used by the current process.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      stime - system time used by the current process.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      cutime - user time used by current process and children.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      cstime - system time used by current process and children.
     </span>
    </li>
   </ul>
   The function returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.posix-times-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 Example use of <span class="function"><strong>posix_times()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$times </span><span style="color: #007700">= </span><span style="color: #0000BB">posix_times</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$times</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>以上示例的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [ticks] =&gt; 25814410
    [utime] =&gt; 1
    [stime] =&gt; 1
    [cutime] =&gt; 0
    [cstime] =&gt; 0
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.posix-times-notes">
  <h3 class="title">注释</h3>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="para">
    This function isn&#039;t reliable to use, it may return negative values for
    high times.
   </p>
  </div>
 </div>


</div><?php manual_footer($setup); ?>