summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Pugh2017-11-16 18:32:48 (GMT)
committerJon Pugh2017-11-16 18:32:48 (GMT)
commit013164652992076c134844e0bd826abb9637c348 (patch)
treed46cb452bc8c043212b276415dbf5f251a559234
parent2c5e2963bb810cda1cc0512016187549806951ad (diff)
Add a timer to provision-robo.php
-rw-r--r--bin/provision-robo.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/provision-robo.php b/bin/provision-robo.php
index 234763f..491feda 100644
--- a/bin/provision-robo.php
+++ b/bin/provision-robo.php
@@ -2,6 +2,8 @@
use League\Container\Container;
use Robo\Robo;
+use Robo\Common\TimeKeeper;
+
// We use PWD if available because getcwd() resolves symlinks, which
// could take us outside of the Drupal root, making it impossible to find.
$cwd = empty($_SERVER['PWD']) ? getcwd() : $_SERVER['PWD'];
@@ -18,10 +20,21 @@ if (file_exists($autoloadFile = __DIR__ . '/vendor/autoload.php')
throw new \Exception("Could not locate autoload.php. cwd is $cwd; __DIR__ is " . __DIR__);
}
+// Start Timer.
+$timer = new TimeKeeper();
+$timer->start();
+
$input = new \Symfony\Component\Console\Input\ArgvInput($argv);
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$app = new \Aegir\Provision\Provision($input, $output);
$status_code = $app->run($input, $output);
+
+// Stop timer.
+$timer->stop();
+if ($output->isVerbose()) {
+ $output->writeln("<comment>" . $timer->formatDuration($timer->elapsed()) . "</comment> total time elapsed.");
+}
+
exit($status_code);