Skip to content
Permalink
Browse files

CliTester: shows idle time in watch mode

  • Loading branch information...
dg committed Feb 12, 2019
1 parent 1bd124b commit 512bd7b225c142fd20f632774afb5fb1117c3273
Showing with 11 additions and 1 deletion.
  1. +11 βˆ’1 src/Runner/CliTester.php
@@ -274,8 +274,18 @@ private function watch(Runner $runner): void
$this->displayException($e);
}
echo "\n";
$time = time();
}
echo 'Watching ' . implode(', ', $this->options['--watch']) . ' ' . str_repeat('.', ++$counter % 5) . " \r";
$idle = time() - $time;
if ($idle >= 60 * 60) {
$idle = 'long time';
} elseif ($idle >= 60) {
$idle = round($idle / 60) . ' min';
} else {
$idle = $idle . ' sec';
}
echo 'Watching ' . implode(', ', $this->options['--watch']) . " (idle for $idle) " . str_repeat('.', ++$counter % 5) . " \r";
sleep(2);
}
}

0 comments on commit 512bd7b

Please sign in to comment.
You can’t perform that action at this time.