Exemplo n.º 1
0
 /**
  * Adds the stopwatch into the manager
  *
  * @param Stopwatch $stopwatch
  * @throws StopwatchAlreadyExistsException
  */
 public function addStopwatch(Stopwatch $stopwatch)
 {
     $name = $stopwatch->getName();
     if (isset($this->stopwatches[$name])) {
         throw new StopwatchAlreadyExistsException(sprintf('The stopwatch with name "%s" already exists.', $name));
     }
     $this->stopwatches[$name] = $stopwatch;
 }