Skip to content

Instantly share code, notes, and snippets.

@dvidsilva
Created October 10, 2012 02:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvidsilva/3862785 to your computer and use it in GitHub Desktop.
Save dvidsilva/3862785 to your computer and use it in GitHub Desktop.
tells you how much it would take to add several lines in your db
<?
ini_set('max_execution_time',0);
//tells you how much it would take to add several lines in your db, change ur password and all that off //course..
//_GET[i] is the ammount of lines
$time_start = microtime(true);
$sql = mysql_connect('localhost','root','magic');
mysql_select_db('test',$sql);
mysql_set_charset('utf8');
for($i = 0; $i < $_GET[$i]; $i++ ){
$data = mysql_query('insert into trial1 set name = MD5(RAND()) ')or die(mysql_error());
}
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Did $i in $time seconds\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment