Exemple #1
0
 /**
  * @return Result
  */
 public function run()
 {
     $stopwatch = new Stopwatch();
     $result = '';
     $stopwatch->start('parsing');
     $this->driver->initialize();
     $stopwatch->lap('parsing');
     for ($i = 0; $i < $this->loopCount; $i++) {
         $result = $this->driver->run($this->content);
     }
     $event = $stopwatch->stop('parsing');
     return new Result($this->driver->getName(), $this->driver->getDialect(), $event, $result, memory_get_peak_usage(true));
 }
Exemple #2
0
 /**
  * @param DriverInterface $driver
  */
 public function addDriver(DriverInterface $driver)
 {
     $this->drivers[$driver->getName() . $driver->getDialect()] = $driver;
 }