Skip to content

Instantly share code, notes, and snippets.

@kadai

kadai/debug_code.php

Created Jul 10, 2017
Embed
What would you like to do?
<?php if (current_user_can('update_core')) { ?>
<p><?php echo get_num_queries() ?> queries. <?php if (function_exists('memory_get_usage')) { $unit=array('b','kb','mb','gb','tb','pb'); echo @round(memory_get_usage(true)/pow(1024,($i=floor(log(memory_get_usage(true),1024)))),2).' '.$unit[$i]; ?> Memory usage. <?php } timer_stop(1) ?> seconds.</p>
<?php } ?>
24 queries. 38 mb Memory usage. 0,656 seconds.
101 queries. 38 mb Memory usage. 2,037 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment