protected function execute(InputInterface $input, OutputInterface $output) { $parts = $this->marshallParts($input); $inputBuffer = $this->marshallInput($input); $output->writeln(sprintf('<question>%s</question>', $this->puzzle->getName()) . PHP_EOL); $bench = new Ubench(); foreach ($parts as $i => $part) { $output->writeln(sprintf('<info>** Part %d: %s **</info>', $i + 1, $part) . PHP_EOL); if (!$input->getOption('short')) { $this->printPuzzleInstructions($output, $part); } $result = $bench->run([$this->puzzle, $part], $inputBuffer); $output->writeln(sprintf($this->puzzle->getPartFormat($part), $result)); $output->writeln(sprintf('Time elapsed: %s | Memory usage: %s', $bench->getTime(), $bench->getMemoryUsage()) . PHP_EOL); } }