示例#1
0
$list2 = array_merge(array(), $list);
$type = array('Normal', 'CacheManager');
$cacheEnabled = array(false, true);
$time = array();
$anz = 10;
$sum = array();
echo "<html><body><table>";
for ($b = 0; $b < 2; $b++) {
    echo '<th><td colspan=3>' . $type[$b] . "</td></th>";
    if (!isset($time[$b])) {
        $time[$b] = array();
    }
    for ($i = 0; $i < $anz; $i++) {
        shuffle($list2);
        foreach ($list2 as $elem) {
            CacheManager::setCacheEnabled($cacheEnabled[$b]);
            $begin = microtime(true);
            $answ = Request::get($elem, array(), '', false, false);
            $t = microtime(true) - $begin;
            if (!isset($time[$b][$elem])) {
                $time[$b][$elem] = 0;
            }
            $time[$b][$elem] += $t;
            if (!isset($sum[$b])) {
                $sum[$b] = 0;
            }
            $sum[$b] += $t;
            CacheManager::reset();
        }
    }
    foreach ($list as $elem) {