jfb_debug_checkpoint

A function for debuging time/memory usage at various points in script execution.

Description

jfb_debug_checkpoint( $label ); 

Calling this function (with a label) will add a checkpoint. All checkpoints will be included in the final log sent to the admin by j_mail

Parameters (1)

0. $label
The label.

Usage

  1. if ( !function_exists( 'jfb_debug_checkpoint' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'wp-fb-autoconnect/__inc_opts.php'; 
  3.  
  4. // The label. 
  5. $label = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jfb_debug_checkpoint($label); 
  9.  

Defined (1)

The function is defined in the following location(s).

/__inc_opts.php  
  1. function jfb_debug_checkpoint($label) 
  2. global $jfb_debug_array; 
  3. if(!is_array($jfb_debug_array)) $jfb_debug_array = array(); 
  4. $time = explode (' ', microtime());  
  5. $time = (double)($time[0] + $time[1]); 
  6. $jfb_debug_array[$label] = array('time'=>$time, 'mem'=>memory_get_usage());