Пример #1
0
 public function run($iterations = 1000)
 {
     $profiler = new Benchmark_Profiler(true);
     foreach ($this->tests as $test) {
         $method = 'config' . $test;
         $args = $this->{$method}();
         $method = 'run' . $test;
         $profiler->enterSection($test);
         for ($i = 0; $i < $iterations; $i++) {
             call_user_func_array(array($this, $method), $args);
         }
         $profiler->leaveSection($test);
     }
     $profiler->stop();
     $profiler->display();
 }
Пример #2
0
define('APPLICATION', '');
// ini_set('open_basedir','/');
// phpinfo();
ob_start();
header("Cache-Control: public");
header("Expires: " . date("r", time() + 3600));
header('Content-Type: text/html; charset=UTF-8');
//echo "<h1>", date("H:i:s"), "</h1>";
// цепляем все функции
require "main.php";
//var_dump(mysql::query('UPDATE  bikes SET  front_page_time =  "2012-10-13" WHERE id =965')); die;
if (DEBUG_SITE == 1) {
    // время выполнения скрипта
    require_once 'plagin/Benchmark/Profiler.php';
    global $profiler;
    $profiler = new Benchmark_Profiler(TRUE);
    $profiler->start();
    // время
    $profiler->enterSection('head');
}
// выводим заголовки
echo head1();
if (DEBUG_SITE == 1) {
    // время
    $profiler->leaveSection('head');
}
unset($_SESSION['GLOBAL_MESSAGE']);
if (!isset($_SESSION['currency'])) {
    $_SESSION['currency'] = SHOW_CURRENCY;
}
if (!isset($_GET['action'])) {