Skip to content

Instantly share code, notes, and snippets.

@d3zorg
Last active December 12, 2015 03:39
Show Gist options
  • Save d3zorg/4709026 to your computer and use it in GitHub Desktop.
Save d3zorg/4709026 to your computer and use it in GitHub Desktop.
simple mysql profiler with built-in mysql tool
<?php
mysql_query("set profiling_history_size=100");
mysql_query("set profiling=1");
#
# your queries here
#
$rs = mysql_query("show profiles");
while($rd = mysql_fetch_object($rs))
{
echo $rd->Query_ID.' - '.round($rd->Duration,4) * 1000 .' ms - '.$rd->Query.'<br />';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment