Skip to content

Instantly share code, notes, and snippets.

@foozlereducer
Last active July 27, 2016 19:01
Show Gist options
  • Select an option

  • Save foozlereducer/fc12f8c37138e60813bd33e8699a5344 to your computer and use it in GitHub Desktop.

Select an option

Save foozlereducer/fc12f8c37138e60813bd33e8699a5344 to your computer and use it in GitHub Desktop.
function mem( $key, $in_or_out = 'in' ) {
if ( ! isset( $this->mem_usage ) ) {
$this->mem_usage = array();
}
$this->mem_usage[ $key ] = array( 'memory' => memory_get_usage(), 'in or out' => $in_or_out );
}
function console_log_mem() {
echo '<script>' . 'console.log(' . json_encode( $this->mem_usage ) . ');</script>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment