title: To get MYSQL query execution time in Query
body: <p>I am developing a query browser, working with some large database and I need to know the time taken for executing the query.</p>
  
  <p>I can see the time once the query is executed succesfully in PHPMYADMIN. </p>
  
  <p>Profiling or <code>Showing rows 0 - 29 (2,000 total, Query took 0.0145 sec)</code></p>
  
  <p>Ex: Profiling</p>
  
  <pre><code>SELECT * FROM `larger_table`;
  
  
  Status                        Time
  starting                     0.000026
  checking permissions         0.000006
  Opening tables               0.000014
  System lock                  0.000010
  init                         0.000022
  optimizing                   0.000004
  statistics                   0.000007
  preparing                    0.000005
  executing                    0.000001
  Sending data                 0.014138
  end                          0.000004
  query end                    0.000002
  closing tables               0.000005
  freeing items                0.000091
  logging slow query           0.000003
  cleaning up                  0.000002
  </code></pre>
  
  <p>In Query Browser I can see the time it takes in the bottom of the browser window.</p>
  
  <p>So how can I get the execution time of the query when submit the query for execution.</p>
  
  <p>i.e When I give the following query:</p>
  
  <pre><code>SELECT * FROM `larger_table`;
  </code></pre>
  
  <p>The query should return the time for execution it. </p>
  
  <p>This I should catch in PHP and show to the Users.When the user gives some query to executed in browser.</p>
  
  <p>Is there any way to find the execution time when the query is submitted.? </p>
  
  <p>Kindly check the Images where I marked the estimated time.
  <img src="https://i.stack.imgur.com/331Tg.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/40zx8.png" alt="enter image description here"></p>
  
  <p>I found some thing <a href="http://forums.mysql.com/read.php?108,51989,230038#msg-230038" rel="noreferrer">Check this</a></p>