Skip to content

Instantly share code, notes, and snippets.

@kadai
Created July 10, 2017 08:01
Show Gist options
  • Save kadai/33a3adaa3399fdde46aec5428fb4525e to your computer and use it in GitHub Desktop.
Save kadai/33a3adaa3399fdde46aec5428fb4525e to your computer and use it in GitHub Desktop.
<?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