<?php /* * This file is part of the Blackfire SDK package. * * (c) SensioLabs <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ if (!class_exists('BlackfireProbe', false) && !extension_loaded('blackfire')) { require __DIR__ . '/BlackfireProbe.php'; BlackfireProbe::getMainInstance(); }
public static function pause($timerName) { if (!self::$_enabled) { return; } $time = microtime(true); // Get current time as quick as possible to make more accurate calculations if (empty(self::$_timers[$timerName])) { self::reset($timerName); } if (false !== self::$_timers[$timerName]['start']) { self::$_timers[$timerName]['sum'] += $time - self::$_timers[$timerName]['start']; self::$_timers[$timerName]['start'] = false; if (self::$_memory_get_usage) { self::$_timers[$timerName]['realmem'] += memory_get_usage(true) - self::$_timers[$timerName]['realmem_start']; self::$_timers[$timerName]['emalloc'] += memory_get_usage() - self::$_timers[$timerName]['emalloc_start']; } } $probeName = filter_input(INPUT_GET, 'probe', FILTER_SANITIZE_STRING); $probeName = rawurldecode($probeName); if (in_array($timerName, explode(',', $probeName))) { $probe = BlackfireProbe::getMainInstance(); $probe->disable(); } }