title: Getting the actual (absolute) execution time of the last query in PHP (excluding network latency etc)
body: <p>I want to get the actual Mysql query execution times while they run in my project so running PHP <code>microtime()</code> before and after and subtracting won't work.</p>
  
  <p>When we run a query in command line, the result displays the timing information something like this:-</p>
  
  <pre><code>xxx rows affected in YY sec
  </code></pre>
  
  <p>How to get the same time information using PHP. I searched in <a href="http://www.php.net/manual/en/ref.mysql.php" rel="nofollow noreferrer">PHP's Mysql functions</a> in other SO question <a href="https://stackoverflow.com/questions/1473029/find-time-to-execute-mysql-query-via-php">Here</a>,and <a href="http://www.phpbuilder.com/board/showthread.php?t=2100256" rel="nofollow noreferrer">here</a> but did not get anything similar. Is there no such PHP function like <code>mysql_error()</code>, <code>mysql_affected_rows()</code> which return other important information? If not why is it not there? Any reasoning? </p>
  
  <p>Someone says - </p>
  
  <blockquote>
    <p>I think that best way to get execution
    time is to use some program execution
    functions like exec() or system().</p>
  </blockquote>
  
  <p>Does anybody have a working PHP code which returns the actual execution time?</p>