/** * Set profiler mark * @param string $name */ public function mark($name = '') { return; // for debug only if (self::$_jbdump !== null) { self::$_jbdump->mark($name); } }
/** * Set profiler mark * @param string $name */ public function mark($name = '') { if (self::$_jbdump !== null && method_exists(self::$_jbdump, 'mark')) { self::$_jbdump->mark($name); } }
?> <h3>Code</h3><?php JBDump(file_get_contents(__FILE__), 0, '-= Code =-::source'); ?> <h3>Result</h3><?php JBDump::memory(); JBDump::mark('start loop'); $bigArray = array(0 => 0); for ($i = 1; $i < 10000; $i++) { $bigArray[$i] = $i + @$bigArray[$i - 1]; } JBDump::mark('finish loop'); unset($bigArray); JBDump::mark('unset $bigArray'); JBDump::mark('start loop #2'); for ($i = 0; $i < 1000000; $i++) { } JBDump::mark('finish loop #2'); JBDump::mark('start loop #3'); $j = 0; for ($i = 0; $i < 1000000; $i++) { $j++; } JBDump::mark('finish loop #3'); echo "JBDump::microtime();"; JBDump::microtime(); echo "JBDump::memory();"; JBDump::memory(); echo "JBDump::microtime();"; JBDump::microtime(); JBDump::i()->mark('other functions');
function m($text) { return JBDump::mark($text); }