Esempio n. 1
0
 /**
  * dump
  *
  * Dumps the results on screen
  * @codeCoverageIgnore
  */
 public static function dump()
 {
     // Clears incomplete timings
     self::$timings = array_filter(self::$timings, function ($t) {
         return isset($t['duration']);
     });
     // Sort the results on duration, in descending order
     uasort(self::$timings, function ($a, $b) {
         if ($a['duration'] == $b['duration']) {
             return 0;
         }
         return $a['duration'] > $b['duration'] ? -1 : 1;
     });
     echo "<pre style=\"clear: both;\">" . print_r(self::$timings, true) . "</pre>";
     if (count(self::$cumulative)) {
         $prev = array();
         echo "<pre style=\"clear: both;\">";
         foreach (self::$cumulative as $i => $data) {
             echo "[" . $i . "] (" . $data['ts'] . ") " . $data['label'] . ": " . ($i == 0 ? 0 : $data['ts'] - $prev['ts']) . "s" . PHP_EOL;
             $prev = $data;
         }
         echo "</pre>";
     }
     echo "</pre>";
 }