These days speed is everything, and with the vast amount of WordPress plugins and widgets available, your site can easily get bogged down. If you are looking to speed and tidy your WordPress site up it is more than likely that you are going to want to know how long a page takes to load and how many MySQL queries the page is running.
All you need to do is copy and paste the below code into one of your theme files (e.g. footer.php):
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
Or if you don’t want this to actually display on the page, you can put it in HTML comments like this:
<!--<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.-->