*
* @var string
*/
- protected $signature = 'chatlib:generate {which=de} {amount=50}';
+ protected $signature = 'chatlib:generate {which=de} {amount=50} {context?}';
/**
* The console command description.
* @return int
*/
public function handle() {
+
+ $start = microtime(true);
+ $this->line('loading database');
$db = new ChatLib();
$db->loadFrom($this->argument('which'));
+ $this->line(
+ number_format(microtime(true) - $start, 2).'s '.
+ number_format(memory_get_usage() / 1024 / 1024, 3).'MB now '.
+ number_format(memory_get_peak_usage() / 1024 / 1024, 3).'MB peak');
$amount = intval($this->argument('amount'));
for ($i = 0; $i < $amount; ++$i) {
- $this->line($db->generate());
+ $this->line($db->generate($this->argument('context')));
}
return 0;