WordPress has some amazing built-in functionality. One such functionality is to be able to display the number of database queries made, along with displaying the number of seconds it took while loading any give page.
We can easily achieve this using two different function. First one is get_num_queries function, to display the number of queries. Second one is timer_stop function to display the seconds.
So, if you want to display this little piece of information to your site visitors, Here is the snippet:
<?php
echo get_num_queries();
echo ' queries in ';
timer_stop(1);
echo ' seconds.';
?>
Simply copy it, and paste it anywhere on your template’s file. My personal suggestion would be to use it on your template’s footer.php page.
Comment
Leave a Reply