Guest User

Untitled

a guest
Nov 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by JetBrains PhpStorm.
  4. * User: shelan
  5. * Date: 9/15/11
  6. * Time: 5:19 PM
  7. * To change this template use File | Settings | File Templates.
  8. */
  9.  
  10. $username = "mahasen";
  11. $password = "mahasen2011";
  12. $host="shelanlkcom.fatcowmysql.com";
  13.  
  14.  
  15. $con = mysql_connect($host,$username,$password);
  16.  
  17. mysql_select_db("uni_test_database", $con);
  18.  
  19. $noOfIteration = 10;
  20.  
  21. for ($i=1; $i<=$noOfIteration; $i++){
  22.  
  23. $time1 = microtime();
  24. mysql_query("SELECT * FROM category_no");
  25. $time2 = microtime();
  26.  
  27. $time1Diff = ($time2 - $time1)*1000;
  28. $totalTime1 = $totalTime1 + $time1Diff;
  29.  
  30. echo '<BR>Parsing Time: for 1 st query' .($time1Diff/10). ' nanoSeconds.';
  31. }
  32.  
  33. echo '<br>Average time for 1st query'.($totalTime1/$noOfIteration).' nanoSeconds'
  34.  
  35. ?>
Add Comment
Please, Sign In to add comment