DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Do you ever asked yourself how long it took for your page to load, or how many sql queries were executed? If yes, here is a simple code to insert on your template.

Nothing hard here. Simply paste the following code on your footer.php file:

<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?>  seconds.

The get_num_queries() function returns the number of executed query during your page loading.

Credits goes to WordPress Tuto for this awesome recipe!

2 Comments

  1. Awesome clean and simple recipes. This will output the code like: 58 queries in 3.057 seconds.

    I will add this code to my plugin using wp_footer action hook.

  2. And where do i get the function get_num_queries() and timer_stop()?

Leave a Comment

Your email address will not be published. Required fields are marked *