adds execution timer

This commit is contained in:
Godfrey M 2024-07-11 10:52:47 -07:00
parent 43c7504f89
commit d4d19569ee

View file

@ -27,6 +27,8 @@ class RemoveExplicitEols extends Command
*/ */
public function handle() public function handle()
{ {
$startTime = microtime(true);
if ($this->option('model_name') == 'all') { if ($this->option('model_name') == 'all') {
$assets = Asset::all(); $assets = Asset::all();
$this->updateAssets($assets); $this->updateAssets($assets);
@ -40,6 +42,9 @@ class RemoveExplicitEols extends Command
$this->error('Asset model not found'); $this->error('Asset model not found');
} }
} }
$endTime = microtime(true);
$executionTime = ($endTime - $startTime);
$this->info('Command executed in ' . round($executionTime, 2) . ' seconds.');
} }
private function updateAssets($assets) private function updateAssets($assets)