Function to Change Display D/B Query Times & Resources

* code #14 - display WordPress database query times and memory consumption in footer
* source -
function footer_stats_display($visible = false) {
$stat = sprintf( '%d queries in %.3f seconds, using %.2fMB memory',
timer_stop( 0, 3 ),
memory_get_peak_usage() / 1024 / 1024);

echo $visible ? $stat : ">!-- {$stat} -->" ;
add_action('wp_footer', 'footer_stats_display', 20);

If you are curious about how your server handles each page load this may be worth adding into your document. This small block will add an HTML comment right at the end of each page in the wp_footer() function. You will see the total number of database queries, how long they took to perform, and how much memory was used on the server.